[ntp:questions] Loop Frequency and Offset

Miroslav Lichvar mlichvar at redhat.com
Tue Sep 27 11:02:47 UTC 2011


On Mon, Sep 26, 2011 at 02:29:42PM +0100, Miguel Gonçalves wrote:
> So... I was getting around 180 ppm frequency offset in /etc/ntp.drift and
> this value also appeared in loopstats file.
> 
> I checked the machdep.tsc_freq value (this is estimated at boot but can be
> changed after the boot completes):
> 
> tick# sysctl machdep.tsc_freq
> machdep.tsc_freq: 498053689
> 
> Now... if the clock is running 180 ppm fast (I assumed slower and the result
> was the opposite i.e. it ran even faster) I have to decrease the frequency
> by 180 ppm:
> 
> 498053689 - (498053689 * 180/1000000) = 497964040

Just a minor correction (but I've seen others do that too). The value
in driftfile is how much the system clock has to be sped up to match
UTC, not how much the clock is slower than UTC. The error is tiny at
such small values, but if you want to invert it accurately, you need
to divide it by 1.000180 instead of multiply by 0.999820.

-- 
Miroslav Lichvar



More information about the questions mailing list