[ntp:questions] setting the time/frequency before starting ntpd to avoid slow convergence (PPS)

Richard B. Gilbert rgilbert88 at comcast.net
Fri Oct 12 23:25:21 UTC 2012


On 10/12/2012 6:25 PM, gabs wrote:
> Instead of waiting several minutes (hours?) to reach microsecond offsets, I've been using a chrony-like
method to set the time and frequency before starting ntpd:
>
It's hours!  About ten hours to get the best time the system is capable of!

> 1. Kill ntpd if running

To what purpose???????

If NTPD is running, your clock should be very close to the correct time. 
  I can't see anything useful to be gained by restarting NTPD.

NTPD needs something like ten hours to reach a steady state with the 
best possible approximation to the correct time.  If at all possible,
run your clock and NTPD 24 X 7.  Also, keep the ambient temperature
within narrow limits if at all possible!


> 2. Reset the kernel flags, offset, and frequency:
>       ntptime -N -s 1 -o 0 -f 0; ntptime -N -s 0
> 3. Set the time within a few ms. If adjtime() is used, wait for the slew to stop.
> 4. Collect PPS timestamps for 30 seconds, then run an L1 regression to estimate the clock frequency and offset.
> 5. Use the estimated frequency to set the kernel frequency and drift file
> 6. adjtime() the estimated offset. Wait for the slew to stop.
> 7. Start ntpd. Expect a few us of offset while ntpd finely adjusts the frequency.
>

Once you have your clock running, leave it running 24x365.  An
uninterruptable power supply is a good thing to have; it lets you ride 
out the brown outs and drop outs.  Another good thing to have is a 
gasoline powered generator for those times when the power company really 
screws up!  You should know BEFORE the power goes off what your
emergency plan expects you to do..



More information about the questions mailing list