Linux – How to configure ntpd to sync time more frequently

linuxntpntpd

I need to set ntpd to sync time as often as possible, how to do that?

UPD I need to make ntpd adjust system clock more frequently, not poll servers. It's necessary because system clock of my virtual PC drifts too much
maxpoll doesn't seem to change anything, because I set minpoll/maxpoll to 4 and 5, and time adjustments seem to be made only once in several minutes

Best Answer

The iburst option does several checks quickly as soon as the daemon is started and whenever the server is unreachable if you have that in your configuration. The burst option does several checks quickly whenever the server is reachable.

By default ntpd then follows an exponential backoff where the time between checks progressively increases, starting at 64 seconds and doubling each time, up to a maximum of 1024 seconds.

The maxpoll option allows you to set the maximum value higher or lower. This value is the power of 2 in seconds between checks, so for 1024 seconds, maxpoll is 10. There is also minpoll which is 6 by default and can be lowered to 4.

If you want anything more frequent than every 16 seconds you will probably need to use ntpdate instead of ntpd and run your own loop.

Please don't aim this at public time servers without contacting the maintainers first.