How to change the NTP polling interval?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 6, 7, 8
  • ntp
  • chrony
  • NTP (Network Time Protocol)

Issue

  • How to configure minpoll and maxpoll values in /etc/ntp.confor /etc/chrony.conf ?
  • How often a RHEL NTP client will poll out to a NTP server?
  • How often does a NTP client synchronize to NTP servers?
  • Is changing the NTP polling interval recommended?
  • What is the default poll interval for ntpd/chronyd?

Resolution

NTP dynamically selects the optimal poll interval between the values of minpoll and maxpoll, which default to 64 and 1024 seconds respectively and are correct for most environments. This values can be set in /etc/ntp.conf (for ntp) or /etc/chrony.conf (for chrony).

NTP dynamically varies this value as conditions change and requires several days of continuous operation to converge on an optimal adjustment value.

The default values should be used for general servers on the Internet. With your own NTP servers, or if you have permission to poll some servers more frequently, setting these options for shorter polling intervals might significantly improve the accuracy of the system clock. The optimal polling interval depends mainly on two factors, stability of the network latency and stability of the system clock (which mainly depends on the temperature sensitivity of the crystal oscillator and the maximum rate of the temperature change).

  • From man ntp.conf (ntp-4.2.6p5-29.el7_8.2) we have below definition:
      minpoll minpoll

       maxpoll maxpoll
               These options specify the minimum and  maximum  poll  intervals
               for  NTP  messages,  in  seconds as a power of two. The maximum
               poll interval defaults to 10 (1024 s), but can be increased  by
               the  maxpoll option to an upper limit of 17 (36 h). The minimum
               poll interval defaults to 6 (64 s), but can be decreased by the
               minpoll option to a lower limit of 3 (8 s).
  • From man chrony.conf:
           minpoll poll
               This option specifies the minimum interval between requests
               sent to the server as a power of 2 in seconds. For example,
               minpoll 5 would mean that the polling interval should not drop
               below 32 seconds. The default is 6 (64 seconds), the minimum is
               -6 (1/64th of a second), and the maximum is 24 (6 months). Note
               that intervals shorter than 6 (64 seconds) should generally not
               be used with public servers on the Internet, because it might
               be considered abuse. A sub-second interval will be enabled only
               when the server is reachable and the round-trip delay is
               shorter than 10 milliseconds, i.e. the server should be in a
               local network.

           maxpoll poll
               This option specifies the maximum interval between requests
               sent to the server as a power of 2 in seconds. For example,
               maxpoll 9 indicates that the polling interval should stay at or
               below 9 (512 seconds). The default is 10 (1024 seconds), the
               minimum is -6 (1/64th of a second), and the maximum is 24 (6
               months).
  • Example:
server myntpserver.example.com iburst minpoll 4 maxpoll 6

Note : Finally, please make sure to restart the ntpd or chronyd service after any change in /etc/ntp.conf or /etc/chrony.conf as below:

[root@localhost] # systemctl restart ntpd

or

[root@localhost] # systemctl restart chronyd

Root Cause

  • Upstream documentation:

2.7. How can I improve the accuracy of the system clock with NTP sources?

5.1.5.2. What is the best polling Interval?

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments