Adjusting clock speed

Chris Jewell chrisj-freebsd-questions at puffin.com
Sat Jul 21 01:02:00 UTC 2007


We have a server running 5.3-RELEASE, whose clock varies somewhat, but
averages about 66 parts-per-million fast.  I know about both xntpd and
ntpdate, but our nominally-full-time Internet connection is not all
that reliable, so I'd like to adjust the speed of the time-of-day
clock so that only an occasional ntpdate, rather than an hourly one,
or the full-scale daemon, is needed to keep our email timestamps
accurate to the nearest second.

In a previously life, I had the same issue with a Linux box, and
discovered a command called adjtimex which helped, but there doesn't
seem to be anything like that on FreeBSD.  My current guess is that
the way to do this on FreeBSD is to tweek one of the sysctl settings,
perhaps increasing machdep.i8254_freq: 1193182 by something like
    66 * (1193162/1000000),

since we're fast by about 66 ppm, or perhaps it's one of the
kern.timecounter.* variables that I need to change, or hw.clockrate, or
....

Anyway, can someone advise me which variable I really need to adjust?
When I try to read the kernel source and figure it out, I tend to get
confused.  Thank you.

(PS: Yeah, I know: I ought to upgrade to 6.2, or at least 5.5, and will
do that sometime soon. :-)  I've been in ``don't fix what's not broken''
mode.  :-) )

And a big thank you to all who make this excellent system possible.

-- 
Chris Jewell  chrisj at puffin.com  PO Box 1396  Gualala CA USA 95445


More information about the freebsd-questions mailing list