Time is on my side

Large parts of the internet are kept in sync with eachother using NTP which stands for Network Time Protocol. Ideally you will point to one or two servers that are (in network terms) nearby and those will either rely on other servers, and so on, until you end up with one that actually keeps track of time with an atomic clock or by listening to its signal.

The general idea behind the protocol is that starts with checking the upstream servers relatively often, then slow down as the software figures it is approaching what it considers the ideal line. The default setup for the Debian ntp-server package is to use a lower limit of 64 (26) and an upper limit of 1024 (210) seconds, but if your machine is on all the time anyway it should eventually be stable enough to only check every couple of hours, and the package supports that! All you have to do is add maxpoll <value> to your server entries in the /etc/ntp.conf file where the value given is the power of 2. So the default is 10, but you can go as high as 17, which will eventually give you a poll interval of a day and a half (36.4 hours)!

I’m actually surprised that the Debian package doesn’t even ask about a higher maxpoll value as that would’ve been the first thing I would’ve increased if I’d realized it was there sooner.

Compare this to Apple (whose OS X installs default to using ntp.apple.com and they probably want to avoid having it be flooded with NTP queries) uses a minimum poll interval of 12 (or 4096 seconds) and the highest possible maximum poll interval. Apparently they still need 4 servers to keep up with all the OS X installs actually doing so!

Oh, and if you pick a server to sync with this way, be sure to choose it The Right Way ™ and not the way Netgear, SMC and D-Link did (or still do, until the firmware of these devices are updated, if ever). The right way would be to pick one from the appropriate pool, of course. In my case, since I’m in the US, that means I use this bit in my /etc/ntp.conf file:

server 0.us.pool.ntp.org maxpoll 17
server 1.us.pool.ntp.org maxpoll 17

I didn’t look for documentation on it but I assume that the numbered sub-pools are because they split them. That will prevent the situation (which I actually ran into a few times) where you use two or more entries like server us.pool.ntp.org in your configuration for increased reliability and (un)helpfully get the same server twice. ;)

Ok, time for dinner, later!