[PATCH 0/5] Fix ntpd to not poll frequently

Miroslav Lichvar mlichvar at redhat.com
Thu Sep 18 14:19:02 UTC 2014


Hi,

I was testing the busybox NTP implementation to see if it doesn't poll
the servers too frequently. This is a big problem for public NTP
servers, where a small percentage of bad clients can take most of the
resources.

Unless a shorter polling interval is needed to keep the clock well
synchronized, an NTP client should be normally always slowly
increasing the polling interval up to a maximum, usually 1024 seconds
or more.

In my testing, the busybox ntpd is working mostly very well, the
polling interval usually reaches the maximum of 4096 seconds, but it
seems there are some cases where it can get stuck at a much shorter
interval or decrease the interval unnecessarily.

This patch set is an attempt to handle these cases better. Testing was
done in a simulator which is available here:

https://mlichvar.fedorapeople.org/clknetsim/

There are other improvements that could be made, like controlling the
interval for each peer separately, but I thought this would be a step
in the right direction.

Miroslav Lichvar (5):
  ntpd: don't wait for good offset before disabling burst mode
  ntpd: don't reset polling interval unnecessarily
  ntpd: split out poll adjusting code
  ntpd: keep increasing polling interval
  ntpd: don't decrease polling interval with large jitters

 networking/ntpd.c | 175 +++++++++++++++++++++++++++---------------------------
 1 file changed, 86 insertions(+), 89 deletions(-)

-- 
1.9.3



More information about the busybox mailing list