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

gabs gsricalde at gmail.com
Fri Oct 12 22:25:44 UTC 2012


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:

1. Kill ntpd if running
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.



More information about the questions mailing list