Re:One second per second is harder than it sounds
by kastnerkyle on Tuesday July 22, 2014 @02:44AM
(#8067642)
The question is - how often do you reboot? For long running high uptime applications "ntpdate at boot" doesn't cut it... and the other solutions are nasty. In my experience, ntpd will ignore clocks almost at a whim even if they are stratum 0! Some stratum 6 clock decides to report a different time, and suddenly all your other sources are ignored until an ntpd restart. If your clock drifted too much... even ntpd restart with options to "force the time" can fail if the clock is too far out of whack. The you are back to forcing ntpdate - hope none of your processes are time dependent when system time jumps by 3 or 4 seconds.
Half of the GPS PCI devices require you to hack ntpd directly to get anything working, and the Ethernet sources have a strange tendency to go belly up after a year or 2 of running on non-120V sources. Not to mention that if you run the antenna cable too long, you might not notice that your GPS amplitudes are a little low until the next cloudy day. Or if someone adds a new hunk of metal on your roof, or blocks line of sight to some portion of the sky...
Long story short, time is a nightmare and I am glad other people think so too.
Re:One second per second is harder than it sounds
by onli on Tuesday July 22, 2014 @03:24AM
(#8067713)
That is the nice thing about chrony. It tries to synchronize clocks even when offline, it works not only on a reboot. If it works as advertized (and I tried it some years ago at home and it worked there, for what it's worth), it should fix all of the issues described in the article.
Re:One second per second is harder than it sounds
by kastnerkyle on Tuesday July 22, 2014 @08:35AM
(#8068576)
Very nice - I will have to check it out! Thanks for the tip.
Re:One second per second is harder than it sounds
by rdtsc on Tuesday July 22, 2014 @09:55AM
(#8068977)
That is why I mentioned to put a watchdog on it. At some point if you ntp server can't be reached, and you have clouds, and don't want to invest in an expensive atomic or maser based clock, you just don't get nice time sync.
Re:One second per second is harder than it sounds
by bradknowles on Wednesday July 23, 2014 @01:31AM
(#8073040)
With appropriate configuration, you can get ntpd to settle down and consider itself to be fully synchronized in a matter of seconds after startup.
You just have to configure an adequate number of upstream time servers, add judicious use of iburst, and you should be good to go.
On my laptop, I usually get good timesync within ten to fifteen seconds of startup.
For S2, it can be configured to never jump. Instead you can just the time manually (run the equivalent of 'ntpdate <server>') at boot perhaps. Then don't start your software until ntp has been synchronized. Then maintain a watchdog that will alert you if you drop to a too low of a stratum.
Don't have an answer for S4 and S5. But I have heard that chrony is a good replacement for ntp (same network protocol but different discipline, faster conversion).
http://chrony.tuxfamily.org/
For a whole new other thing there is PTP (https://en.wikipedia.org/wiki/Precision_Time_Protocol). This is good if you want to synchronize machines to each other to withing a couple of hundred micros (maybe more with special network cards and switches).