[ntp:questions] no ntp synchronisation: 2s to 6s time shift !

Serge Bets serge.bets at NOSPAM.laposte.invalid
Tue Feb 12 16:41:22 UTC 2008

Hello again Thierry,

 On Tuesday, February 12, 2008 at 10:58:32 +0100, Thierry MARTIN wrote:

> Can anyone tell me if a time shift greater than 2s per day is
> ""normal"" on a linux system that has no "external" synchronisation
> (ntp)?

Absolutely normal: that's only 23 PPM, nothing. I have seen machines
that do better, and some that do much worse. As long as it's stable,
2 secs/day every day, and below 500 PPM, it's zeroifiable via the kernel
clock frequency setting. Even above 500 PPM, with help from --tick.

> I tryied "adjtimex -a" which gives unreliable results

This --adjust thing is quite reliable, easely to the single PPM (less
than 0.1 secs/day), provided you already carefully calibrated its
reference: The RTC, via hwclock and /etc/adjtime.

There are plenty of other methods to get an accurate kernel clock
frequency. I'll propose one: run ntpd on the machine during some hours
or a day, with a good connection to (a) good server(s). Then the
following days restore the wanted kernel frequency via:

| # ntptime -f $(cat /var/lib/ntp/ntp.drift) > /dev/null

Or via:

| # adjtimex --frequency $(awk '{printf "%.0f", $1 * 65536; exit}' /var/lib/ntp/ntp.drift)

Cordialement, Serge.
Serge point Bets arobase laposte point net

More information about the questions mailing list