[ntp:questions] Severe time drift for Undisciplined Local Clock
Michael L. Semon
mlsemon33 at verizon.net
Fri Mar 30 01:55:29 UTC 2007
deon at nulan.co.za wrote:
> Hi all
> We have a setup for a group of Linux machines (2.6.8 kernel,FC3) which
> is NOT connected to any outside network. One of the machines has been
> made the Time Server. It uses as it's reference the on-board hardware
> clock (computer motherboard hardware clock, Real Time Clock (RTC)). In
> NTP terminology this referred to as the Undisciplined local clock.
> These machines all perform the same function and has some I/O cards
> that causes a heavy interrupt load. The Linux System Clock is
> synchronised to the hardware clock yet experiences upto 1 hour
> timedrift per month!
> I have attempted various solutions to no avail. I have read that a
> very high interrupt load will cause the kernel to miss clock cycles
> but why would that matter if the source is a piece of external
> hardware? Further, it seems that the kernel is adjusting the RTC since
> when you get the time from the RTC, it's the same as the System Clock.
> I have checked that the kernel is not in in "11 minute mode" by using
> adjtimex (as per the man page of hwclock). Perhaps I am reading it
> In any case here is my /etc/ntp.conf file:
> restrict default nomodify notrap
> restrict 127.0.0.1
> server 127.127.1.0 prefer
> fudge 127.127.1.0 stratum 0
> driftfile /var/lib/ntp/drift
> broadcastdelay 0.008
> restrict <ipaddres.255>
> My /etc/adjtime file contains nothing
> Any suggestions will be appreciated!
Read the man page for the adjtimex utility again:
All of the math you need to correct for a 1 hour per month drift should
be in there. At your rate of drift, you'll need to adjust the tick as
well as the frequency.
That's an answer for a clock that is drifting badly at idle. What
you're asking requires you to know your that your I/O load is stable all
of the time, so that you can compensate for roughly the same number of
lost interrupts. Else, your clock may gain relative time when the
interrupt load goes away. Best of luck.
Almost all of the RTC stuff is about the kernel writing its time down to
the hardware clock (like `hwclock --systohc`) and not the other way
around (like `hwclock --hctosys`). I hope you're not thinking of the
clock on the mobo like it's a good piece of hardware. Sometimes it's
good, sometimes it's awful.
It would be so much easier if you got a refclock. You can start out
using a simple GPS that speaks NMEA and has the appropriate serial
cable. Even running a friend's GPS for 10 or 12 hours will help you to
refine your calibrations.
At the very least, find a PC that can be left idle and serve the time.
It can be an old PC.
More information about the questions