[ntp:questions] clockstats pausing during ntpq poll

unruh unruh at invalid.ca
Fri Feb 17 16:44:12 UTC 2012


On 2012-02-17, Dave Hart <hart at ntp.org> wrote:
> 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 127.127.22.0 -0.000033126
>>> 55974 21824.099 127.127.22.0 -0.000026711
>>> 55974 21825.994 127.127.22.0 -0.000010522
>>> 55974 21826.993 127.127.22.0 -0.000039330
>>> 55974 21827.994 127.127.22.0 -0.000019143
>>> 55974 21829.099 127.127.22.0 -0.000006765
>>> 55974 21830.993 127.127.22.0 -0.000023575
>>> 55974 21831.993 127.127.22.0 -0.000033386
>>> 55974 21833.102 127.127.22.0 -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

Uh. Yes, there are!. Maybe no the ones he mentions, but there are
missing seconds.

The rounded figures are 
23 24 26 27 28 29 31 32 33
     ^           ^



> 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 :)
>
> Cheers,
> Dave Hart



More information about the questions mailing list