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

K Nandha 1 Reputation point
2021-08-25T14:43:41.11+00:00

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,637 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 51,346 Reputation points
    2021-08-25T15:11:28.993+00:00

    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,721 Reputation points
    2021-08-25T18:01:20.883+00:00

    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.

    https://learn.microsoft.com/en-us/windows-server/networking/windows-time-service/configuring-systems-for-high-accuracy

    1 person found this answer helpful.