How to avoid time delay of few seconds found between linux and windows server in current UTC timevalue?

K Nandha 1 Reputation point

There is a delay or time difference found in current UTC time between Linux and Windows(SQL server) machine. How to sync both machines to same value with allowable difference in fraction of milliseconds ?

Windows OS: Windows 2016
Linux: RHEL 7.9 Maipo

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,240 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 49,071 Reputation points

    This is not just a problem between Linux and WIndows but against any 2 machines. Time naturally drifts on machines. The longer a machine goes without syncing with an internet time server the worse it gets. Windows syncs regularly provided it has INet access but I don't know about Linux.

    This is a machine management issue. You should ensure your servers are syncing regularly to an inet time server. Then you should just add a fudge factor for how much drift you are OK with. For example if you are doing hourly calculations then a drift of +-10 minutes might be fine but if you are doing every 5 minutes then perhaps 1 min is good enough. Provided the servers are syncing regularly then the differences should be very small.

    1 person found this answer helpful.

  2. Tom Phillips 17,716 Reputation points

    This is not really a SQL Server question but an OS question.

    You are never going to get fractions of ms difference between servers. The system clock is only accurate to about 1 second.

    This is how you setup your clock in Windows to be about 1 second.

    1 person found this answer helpful.