[ntp:questions] clockstats pausing during ntpq poll

Dave Hart hart at ntp.org
Fri Feb 17 13:52:22 UTC 2012

On Fri, Feb 17, 2012 at 06:06, A C <agcarver+ntp at acarver.net> wrote:
> As part of my testing I'm observing the main log, peers, loops, and
> clockstats in one window while I observe ntpq (running on a different
> machine) polling the server every five seconds.  The PPS refclock has flag4
> set so that clockstats are recorded.
> What I've noticed is that normally the clockstats is updated once per second
> as the PPS ticks.  However, during a query by the remote ntpq instance, the
> clockstats file pauses for about one second and then resumes.  You can see
> it below in a direct copy from the clockstats file.  There's a missing
> 'tick' at 21828 seconds and one at 21832.  PPS is most certainly ticking at
> these times.  It is extremely obvious, when the two terminal windows are
> side by side, that the ntpq poll freezes ntpd.
>> 55974 21822.994 -0.000033126
>> 55974 21824.099 -0.000026711
>> 55974 21825.994 -0.000010522
>> 55974 21826.993 -0.000039330
>> 55974 21827.994 -0.000019143
>> 55974 21829.099 -0.000006765
>> 55974 21830.993 -0.000023575
>> 55974 21831.993 -0.000033386
>> 55974 21833.102 -0.000004012

Round those figures in the 2nd column to whole seconds and you'll note
there are no missing PPS events.  You don't say which ntpq query, so
I'll assume you're using ntpq -c peers aka ntpq -p.  Be advised that's
actually a number of polls under the covers.  Where ntpq -crv sends a
single query and gets a single response, the peers billboard first
queries for the list of associations IDs (a la ntpq -c lassoc but
without the display), then for each association queries the peer
variables (a la ntpq -c "rv ####" where #### is the association ID)
and displays the output formatted as a single line of the billboard,
rather than the raw var=value form.  I'm guessing you're doing all
this on the machine running ntpd which is rather underpowered in both
processor and graphics by today's standards.  You might lessen the
drag your query loop and graphics updating is placing on ntpd by
treating the underpowered box as a headless server and avoid running
even X clients on it, restricting your access to ssh and ntpq traffic
from a junkbox PC that is 1/3 the age :)

Dave Hart

More information about the questions mailing list