Braedon McDonald

Setting up a server for the NTP Pool Project

November 22, 2026

I read a Hacker News post about how easy it is to set up an NTP server for the NTP Pool Project. The idea of having my existing server that hosts my personal website also be a part of this cluster of time servers sounded intersesting to me so I decided to look into it. In the end, It ended up requiring quite a bit of research before I got it up and running and this post will describe how I got there.

NTP stands for Network Time Protocol and allows machines to synchronize their time over packet switched networks, such as the internet. The NTP Pool Project provides a service that allows you to sync your time to their pool of servers spread across the globe. The pool will try to select the best servers for you so your time can be as accurate as possible. The central infrastructure that manages the time-servers as well as the time servers themselves are volunteer driven, anyone can add themselves to the pool and contribute.

One thing to note if you're not familiar with the protocol is server hierarchy. At the very top of the hierarchy you have what are known as reference clocks. These are extremely accurate time keeping devices, the best known of which might be atomic clocks. These devices sit at stratum 0 but they cannot be queried directly. Stratum 1 servers, have their time synced to within a few microseconds of their stratum 0 device. Stratum 2 servers connect to stratum 1 servers and so on. It's a bit more complicated than that but it's not worth going into for this post.

Network Time Protocol servers and clients.svg
The server hierarchy. Click the image to go to wikimedia

I chose to use chrony as the actual NTP implementation to run on my server. Reading through forum posts convinced me to use it over ntpd which is considered a legacy implementation.

The first part of my configuration file looks like this:

server ntp.torix.ca iburst
server time.nrc.ca iburst
server time.chu.nrc.ca iburst
server ntp.cpsc.ucalgary.ca iburst
server timelord.uregina.ca iburst
            

These are the servers my chrony instance will use to synchronize its time. I found these servers using a public listing of time servers. The NTP Pool Project recommends having at least four and no more than seven servers. Chrony needs three servers to come to a consensus and the rest are for redundancy. I chose a server in Toronto (torix) because that's where my server is located. Then I chose two servers in Ottawa provided by the National Research Council of Canada because that's pretty close to Toronto and I think it's cool to use servers from the NRC. Then I chose a couple more servers from out west for redundancy. Using all Canadian servers was just for fun!

Let's see how the servers are behaving:

my-server:~# chronyc sources

MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* ntp2.torix.ca                 1  10   377   909    -40us[  -52us] +/- 2219us
^- time13.nrc.ca                 2  10   377   721   +306us[ +306us] +/- 8232us
^- time1.chu.nrc.ca              2  10   377   634  +1058us[+1058us] +/-   12ms
^- ns2.cpsc.ucalgary.ca          2  10   377    34   -171us[ -171us] +/-   72ms
^- sue.cc.uregina.ca             2  10   377   530   +617us[ +617us] +/-   64ms
            

The first thing you might notice is the server names in the configuration don't quite match what's shown in the name column, such as ntp2.torix.ca instead of just ntp.torix.ca. This is most likely because the domains used in the configuration actually distribute the traffic to multiple servers using round-robin DNS. Next, you'll see to the far left that there is a star next to ntp.torix.ca. This means chrony has chosen it as the best source of time and is using it to synchronize my servers clock. The number to the far right shows the estimated error. The best server has an error of around 2 milliseconds which is pretty good considering Wikipedia says NTP is intended to synchronize to within a few milliseconds. The rest of the sources are not nearly as good but they serve as good enough backups. Lastly, take a look at the stratum column. I have a mix of stratum 1 and stratum 2 servers. NTP allows a server to sync to upstream servers of different strata, it just means that my servers stratum will be the highest upstream stratum plus one. This makes my server a stratum 3 server.

As a tangent, it can be fun to tell chrony to choose random servers from the NTP Pool and see who is volunteering their computers to keep the world in sync. You can do this my adding the line pool pool.ntp.org iburst maxsources 5 to get five servers from the pool. If you're lucky, some of the listed sources might also have web servers. Note, don't do this while you are serving traffic as these operators might not want to be upstream servers themselves. Anyway, Lets take a look:

MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^- ntp1.yyz.ca.hojmark.net       2   6   377    60  -2815us[-2815us] +/-   21ms
^- host.ca2.h.wer.ee             3   6   377    61  +1544us[+1469us] +/-   18ms
^- s-216-232-132-21.bc.hsia>     2   6   177    40  -1594us[-1594us] +/-  267ms
^* 173-206-125-128.cpe.dist>     1   6   377    60   -523us[ -598us] +/- 5796us
^+ mail.coreserv.net             2   6   377    59   +780us[ +780us] +/-   12ms
            

Interesting, interesting... let's take a look at the first entry. Entering hojmark.net into a web browser gives a hit! It brings you to someone's lovely homepage that appears to have been running since 1994. Clicking around a bit more and you can find a summary webpage of this operator's time servers over at time.hofmark.net. At the time of writing there are seventeen servers spread across the globe! That is dedication.

Getting back on track, the rest of the configuration file looks like this:

driftfile /var/lib/chrony/chrony.drift
dumpdir /var/run/chrony
rtcsync
makestep 1.0 3
allow

# Use 50,000,000 bytes of memory to keep track how many requests each client is
# sending to rate limit to 8 requests per IP per second after a burst of 16 
# requests
clientloglimit 50000000
ratelimit interval -3 burst 16

# Uncomment the following line to turn logging on.
#log tracking measurements statistics
#logdir /var/log/chrony

# Get TAI-UTC offset and leap seconds from the system tz database.
# This directive must be commented out when using time sources serving
# leap-smeared time.
leapsectz right/UTC
            

Most of the information for this section of the configuration was found in the chrony examples documentation. The most important line is the allow directive which allows client connections from all addresses making it a server instead of just a client. I added the rate limit stuff after reading this discussion. I left the logging commented out but might play around with it later.