A selected server will be indicated by *. But how much time will this take to select a peer from the pool if ntp service is restarted?

I'm trying to monitoring NTP server offset but every time i restart the service the selection process takes a while and wanted to know how long it'd take.

~$ ntpq -p
remote           refid      st t when poll reach   delay   offset  jitter
*time4.stupi.se  .PPS.            1 u    2  128  377    7.796   16.636   4.146
+213-21-116-142.    2 u   18   64  377    8.261   17.013   3.807
+ntp.xpd.se    2 u   38   64  377    8.855   20.929   2.537
+mail.joacimmeli    2 u   28   64  377    9.228   19.509  25.804
+juniperberry.ca    2 u   26   64  377   44.612   19.835   2.443
  • Your configuration doesn't appear to be using NTP pools, but rather a static list of servers. (Or it's an older version which doesn't support pools properly.) Can you clarify whether you mean NTP pools, or are just referring to the list of peers in your configuration generically as a "pool"? Including your configuration would be helpful. – Paul Gear May 2 '20 at 20:35
  • I copied that output from a site. But I'm talking about monitoring ntp server that uses pool.ntp.org. All my clients sync from that ntp server and I monitor them. But I also want to monitor the NTP Server itself just in case the ntp server is very behind also I need to configure an item to let me know if the ntpserver hasn't selected a peer within n minutes. But I just wanted to know how long it usually takes to select a peer. I've right now set it to alert me if no peer selected within 10 minutes but was also curious how long it takes since I can't find a reference to that anywhere. – R0bert2 May 3 '20 at 13:00
  • Although the ntpq -p output looks as same mine. Basically it lists a list of servers (peers) and marks with * for selected peer. – R0bert2 May 3 '20 at 15:02

According to the NTP docs, it takes a minimum of 6 polls to achieve synchronization. With pools, the recommended way to achieve this is by use of the iburst option on the pool directive, e.g.

pool pool.ntp.org iburst

By using iburst, you should achieve synchronization with the first contact of the pool hosts. This should take no more than a few seconds (depending on your upstream bandwidth), so 10 minutes seems a reasonable cutoff for lack of synchronization.

Normally, ntpd will select a few hosts from each pool defined in the configuration, then discard the less accurate peers over time, settling on the best hosts after a few polls - usually it's 4 hosts, but that's just my observation and isn't documented behaviour, as far as I know.

If you have operational requirements for NTP monitoring, you might want to consider using an existing monitoring solution rather than a home-grown one. I wrote an overview of NTP alerting & telemetry solutions a few years ago which might be helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.