IMac – ntpd not updating time

imacmacosntp

I had updated my old iMac to Mavericks just fine. I then bought a new (certified refurbished, actually) iMac and migrated everything over from a Time Machine backup.

The new iMac's clock loses several seconds a day. When I unlock the Date & Time system preference, the time then synchronizes to the correct time immediately. But then it just loses time again.

I read this answer and now have a total of 3 time-servers, but it doesn't seem to solve my problem.

In the system.log file, there are these relevant messages:

Dec  3 22:31:34 iMac.local ntpd[66350]: SYNC state ignoring +0.155735 s
Dec  3 22:31:35 iMac.local ntpd[66350]: ntpd: time set +0.308737 s
Dec  3 22:31:35 iMac.local com.apple.time[158]: Interval maximum value is 946100000 seconds (specified value: 9223372036854775807).

The Interval maximum value one doesn't look good.

Anybody know how to fix this so that the time stays sync'd?


Update

It took a little while, but the addition of multiple time servers did make it better (not perfect, but better). Now it gains time, but seemingly at a much slower rate.

If the addition of multiple servers (3 in total) had anything to do with making it better, perhaps (?) the addition of yet more servers will make it better still. I now have a total of 5 servers in ntp.conf. I'll watch it over the next couple of days and see what happens. (Even if this fixes it, this still doesn't answer why all of this is necessary to fix it in the first place. An answer to that would be nice, but I'll settle for it just being fixed at this point.)

BTW: you can set multiple via the System Preferences GUI: just type server names into the field with commas to separate them. This keeps the GUI and the file in sync.

BTW #2: here's the site I got the list of publicly accessible NTP servers from.

Best Answer

Well, some of these questions (your bullet list including "why 5 servers") are a little difficult to answer, time synchronization is quite the rabbit hole. The old parable about the man with one clock knowing what time it is but the man with two never being sure...

One server is an obvious "truechimer" always because there's nothing to invalidate it. Two servers is the "worst possible configuration" according to the NTP authors since it will never know which one is "more" correct. Once you get to three servers NTP can begin to mark clocks as "falsetickers" based on some internal metrics - those will show up with a status of 'x' when you run ntpq -p on the system. More information about what the columns and status indicators are for that command is available on ntp.org.

To get back to the issue at hand, a few notes:

  • placing the line pool us.pool.ntp.org iburst in your /etc/ntp.conf file will automatically add four stratum 2 ntp servers from the ntp pool to your time server list. These use DNS round-robin rotation to spread out load. If you are not in the US, there are other pools you can use.

  • you can't do the pool configuration line from the System Preferences GUI; you could, however, put the following in which would have the same effect: 0.us.pool.ntp.org, 1.us.pool.ntp.org, 2.us.pool.ntp.org, 3.us.pool.ntp.org.

  • in selecting time servers yourself, you should always ensure you select "stratum 2" or higher servers (best practice online is to only go to stratum 1 servers if you are serving time to dozens of machines locally). you'll also want to check policies in the public time server list before altering the default minpoll/maxpoll with public servers, some administrators do not want you to change from the defaults (this can place a higher load on their public servers). The best approach is to just use the NTP pool servers.

  • I am also seeing a substantial change in time quality since upgrading to Mavericks. I have just added more servers as you did to see if that solves the issue, but something definitely changed. I have a stratum 1 server on my local network and the clock on my iMac drifts all over the place whereas prior to the Mavericks upgrade it didn't.