Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Mar 2015 18:48:04 -0700
From:      Rick Thomas <rbthomas@cs.rutgers.edu>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: How to adjust clock frequency in FreeBSD 10.1 ?
Message-ID:  <3FCD9F24-D319-41D2-A670-53A8E2ACE16D@cs.rutgers.edu>
In-Reply-To: <61602B0F-2114-4B65-A576-34EDDF94EAFA@pobox.com>
References:  <AE5A370C-A7F7-41D2-900D-B26521A2D705@pobox.com> <54EDC2DD.8060307@gmx.de> <61602B0F-2114-4B65-A576-34EDDF94EAFA@pobox.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 02/12/15 04:09, Rick Thomas wrote:
>> I=92ve got a machine with a really bad clock.  When I run NTPD on it,
>> the freq goes straight to 500.0 (over a period of a few days) and
>> stays there, while the offset grows and grows.
>>=20
>> I recently switched this machine from Debian Linux to FreeBSD
>> (wanting to learn more about FreeBSD).  Under Linux, I used
>> adjtimex to modify the TICK value and (once I had converged on the
>> right TICK value) NTP was able to stabilize the clock.
>>=20
>> Is there an equivalent hack for FreeBSD?

On Feb 25, 2015, at 4:41 AM, lokadamus@gmx.de wrote:
> You can use a cronjob with ntpdate to synchronize your clock.
> But ntpd shouldn=92t run, when ntpdate is used.
>=20

As it turns out, current versions of ntpd will do as well as (actually =
better than) periodic ntpdate =97 even under such adverse circumstances =
as this machine.  What it does is to attempt to slew the time using its =
normal algorithms until the frequency adjustment gets pegged at 500ppm =
and the offset is over 1 second. Then it steps the clock and starts the =
game all over.  This is better than previous versions of ntpd and xntpd. =
 They would get to that point and abort =97 on the theory that something =
was acutely wrong and needed human operator attention.  Current versions =
at least have the option of plugging on as best as possible.

So, with current ntpd, the system clock is never more than about 1 =
second off from network time.

And for a normal desktop machine (or ever a small-/home-office server) =
that=92s really good enough and I should stop complaining.  BUT=85

The trouble is, I=92m a =93time nut=94 and I keep this machine (and a =
few others) around specifically as a test case =97 to prove that it *is* =
possible to keep good time (sub millisecond offsets from a GPS server on =
the same LAN) even with machines that are out of spec, as long as they =
are *reliably* out of spec.

I=92ve succeeded in twisting Linux to my ends as noted in my original =
post (quoted above), but so far I haven=92t found a way to do that for =
FreeBSD, short of custom modifications to the kernel and/or ntpd.

Any and all suggestions will be gratefully received.

Enjoy!
Rick

PS: Does anybody know if there=92s a FreeBSD package for P-HK=92s =
Ntimed?





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3FCD9F24-D319-41D2-A670-53A8E2ACE16D>