Subject: Re: clock accuracy
To: KITAMURA Yasuichi <kita@koganei.wide.ad.jp>
From: Armen Babikyan <armenb@moof.ai.mit.edu>
List: port-mac68k
Date: 02/22/1999 13:09:16
At 2:53 PM +0900 2/22/99, KITAMURA Yasuichi wrote:
>Dear NetBSD experts,
>
>I installed 1.3.3 on my SE/30 and it works very well except one point. The
>issue is the clock or time accuracy. The clock of the SE/30 is as accurate
>as other Macintoshes, I think, on MacOS(7.5.5:-)). The time difference from
>the NTP server is about 3 sec in maximum. But when I switch to NetBSD, the
>accuracy goes down. The time differenece from an NTP server is about 20
>minutes per a week.
>
>Is this the special case or is it the well-known issue?
>
>Thank you for all your help.
>

Yeah.

ntp has this preset "drift" variable in its code. By default, this value is
set it 500, meaning that if the OS drifts less than 500 units by the next
time it looks to update the time, it'll reupdate it.  If the drift ever
gets higher than 500, ntp doesn't update the time anymore. This is why
xntpd doesn't work reliably in NetBSD (all of a sudden, it just stops
fixing the clock). Maybe the people who wrote xntpd decided that if the
drift was higher than 500, there was something wrong somewhere and it
should leave the time as it is. On mac68k, its a known hardware problem.

the units are probably some fraction of a second amount of drift per second
of real time (and in which direction, + or -).

I got the sources to ntpd and replaced the MAXFREQ value with 5000,
originally, and that kept updating the time for quite some time.  However,
this became an upper limit too, so I recompiled ntpd to have a drift factor
of 50000, which seems to work fine for now.  My clock gets updated properly.

My IIvx (33Mhz 68030) is fairly loaded at times - running an IRC server,
webserver, and an appletalk network tunnel server. (the last takes up lots
of cpu and network) - perhaps that's why my drift limit is 50000.  People
on less active computers could probably tone down that amount.

I don't know if this is a really kosher way of updating the time, but
whatever. It works :)

later,

  - a