[ntp:questions] NTP vs chrony comparison (Was: oscillations in ntp clock synchronization)

David L. Mills mills at udel.edu
Tue Jan 22 16:19:34 UTC 2008


I knew Linux was broken, but what you report suggests it is broken 
beyond my wildest imagination. First, I do know Linux supports the 
precision time kernel, as it has the ntp_adjtime() system call, even if 
it is buried in a wrapper. If so, and assuming that syscall is 
implemented correctly, it doesn't matter whether ticks are significant 
or not.

Second, Linux has completely broken the initial frequency computation 
and intended semantics of the frequency file. The really serious and sad 
issue here is that Linux has added much unnecessary baggage that 
disables or distorts the carefully engineered design principles. It 
would be much, much better to rip out all that baggage and use only what 
comes with the bare ntpd. Certainly, at least Solaris and FreeBSD have 
no such baggage.

I know that at least one time in the past ntpd ran just fine on Linux, 
at least the ntpd version that leaves here, not the one that comes with 
Linux. If this is still the case, your course is clear.


Petri Kaukasoina wrote:

> Unruh  <unruh-spam at physics.ubc.ca> wrote:
>>After I collect more data on steady state, I will rerun startups both with
>>no drift file and a bad drift file to see how fast the convergence is with
> Hi,
> On recent Linux kernels, I think the drift file is always bad after reboot.
> HZ=100, no dynamic ticks aka tickless system (CONFIG_NO_HZ not set). I think
> I even tried with a kernel command line option lpj= but it didn't help.
> If the system is rebooted, ntpd stabilizes to a new different drift value.
> With a bad or missing drift file, time set with ntpdate, ntpd can soon take
> the offset to a 100 or 200 ms error for a long time.
> If you are using Linux and are experimenting with these, please try
> something like this which has given me good results (a coarse calibration of
> the drift file during boot before starting ntpd):
> #!/bin/sh
> DRIFTFILE=/etc/ntp/drift
> NTPSERVER=ip.address.of.a.good.nearby.ntp.server
> TIME=100
> # remember to stop ntpd first if running
> # reset frequency offset to zero
> adjtimex -f 0
> # calibrate clock rate during $TIME seconds
> ntpdate -sb $NTPSERVER
> sleep $TIME
> ADJUST=$(ntpdate -b $NTPSERVER | sed 's/.*offset \(.*\) sec.*/\1/')
> # ntpdate adjusted $ADJUST seconds
> FREQUENCY=$(echo "scale=3; $ADJUST * 1000000 / $TIME" | bc)
> # reset the drift file and start ntpd
> /etc/rc.d/rc.ntpd start

More information about the questions mailing list