Running a Stratum 2 NTP server for ntppool.org on a VPS

As I moved my VPS to a new provider I’m having the luck of having a spare Contabo VPS server for a month.

Unlimited bandwidth, 6 cores and 1.7TB of available harddisk. What to do with it? Let’s run a Chrony NTP server and add it to ntppool.org.

Installing chrony

# apt install chrony 

The configuration of /etc/chrony.conf is simple:

# Include configuration files found in /etc/chrony/conf.d.
confdir /etc/chrony/conf.d


# Time makers
server ptbtime1.ptb.de iburst nts
server ptbtime2.ptb.de iburst nts
server ptbtime3.ptb.de iburst nts
pool time.nist.gov iburst maxsources 3
pool time.nrc.ca iburst maxsources 3

# University of Erlangen is having a big NTP S1 cluster
server ntp2.ipv6.fau.de iburst
server ntp3.ipv6.fau.de iburst

# Apple / FB / Google are having a dense NTP Anycast network pool
pool time.apple.com iburst maxsources 3
pool time.facebook.com iburst maxsources 3
pool time.google.com iburst maxsources 3

sourcedir /run/chrony-dhcp
sourcedir /etc/chrony/sources.d
keyfile /etc/chrony/chrony.keys
driftfile /var/lib/chrony/chrony.drift
ntsdumpdir /var/lib/chrony
logdir /var/log/chrony

# Stop bad estimates upsetting machine clock.
maxupdateskew 100.0

rtcsync
makestep 1 3
leapsectz right/UTC

# Allow everybody to connect to us
allow

. Open the port on your firewall and you are done.

# ufw allow ntp

Having a look at the ‘sourcestats’ and ‘tracking’ of Chrony shows us that the server is behaving nicely.

# chronyc sourcestats

Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
==============================================================================
ptbtime1.ptb.de            33  17  131m     +0.006      0.019  -2902us    45us
ptbtime2.ptb.de            26  14  129m     -0.005      0.022  -3017us    49us
ptbtime3.ptb.de            32  13  131m     +0.002      0.020  -3042us    65us
time-d-b.nist.gov          35  19  139m     +0.006      0.017   -640us    60us
time-d-wwv.nist.gov         6   4   56m     +0.052      0.209   +741us    74us
time-e-wwv.nist.gov        35  23  139m     +0.001      0.032   +430us   117us
time.nrc.ca                35  22  139m     -0.056      0.185  +7089us   582us
time13.nrc.ca              35  19  139m     +0.002      0.114  +4713us   382us
time12.nrc.ca              35  16  138m     +0.011      0.210  +7038us   635us
ntp2.rrze.ipv6.uni-erlan>  34  17  127m     +0.002      0.014  -6034us    39us
ntp3.rrze.ipv6.uni-erlan>  34  15  127m     +0.002      0.013  -5961us    39us
defra1-ntp-002.aaplimg.c>  29  15  135m     +0.000      0.014    +49ns    39us
nlams2-ntp-001.aaplimg.c>  35  16  139m     +0.013      0.178   +932us   586us
ntp.euro.apple.com         26  15  129m     +0.004      0.014  +3241us    45us
time4.facebook.com         34  17  139m     +0.002      0.031   +535us   120us
time5.facebook.com         34  23  130m     +0.054      0.159  +1290us   556us
time3.facebook.com         35  18  138m     -0.011      0.116   +999us   439us
time1.google.com           34  16  130m     +0.013      0.039  -1160us   130us
time1.google.com           33  20  133m     +0.023      0.034  +1329us   105us
time4.google.com           32  14  112m     +0.012      0.024  +1927us    67us


# chronyc tracking

Reference ID    : 11FD36FD (defra1-ntp-002.aaplimg.com)
Stratum         : 2
Ref time (UTC)  : Thu Jan 06 11:20:06 2022
System time     : 0.000007916 seconds fast of NTP time
Last offset     : +0.000000717 seconds
RMS offset      : 0.000213277 seconds
Frequency       : 4.769 ppm fast
Residual freq   : +0.000 ppm
Skew            : 0.015 ppm
Root delay      : 0.003379680 seconds
Root dispersion : 0.000724754 seconds
Update interval : 1041.0 seconds
Leap status     : Normal

After adding the server to NTPPool and selecting 1 GBit available of NTP bandwidth we can see some upcomming traffic from users all over the world (but mostly Europe). The amount of average traffic is manageable and doesn’t disturb the operation of the other services. It’s not even using a fractíon of the available uplink.

Averaged traffic statistics over a few days.

# vnstat -h 96h

 ens18  /  hourly

         hour        rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     2022-01-04
         07:00     48.08 MiB |   47.20 MiB |   95.28 MiB |  222.03 kbit/s
         08:00    376.23 MiB |  371.94 MiB |  748.17 MiB |    1.74 Mbit/s
         09:00    415.04 MiB |  405.38 MiB |  820.42 MiB |    1.91 Mbit/s
         10:00    403.75 MiB |  397.65 MiB |  801.39 MiB |    1.87 Mbit/s
         11:00    392.41 MiB |  384.66 MiB |  777.07 MiB |    1.81 Mbit/s
         12:00    415.19 MiB |  407.49 MiB |  822.68 MiB |    1.92 Mbit/s
         13:00    425.63 MiB |  417.38 MiB |  843.00 MiB |    1.96 Mbit/s
         14:00    404.17 MiB |  396.77 MiB |  800.94 MiB |    1.87 Mbit/s
         15:00    428.08 MiB |  421.13 MiB |  849.21 MiB |    1.98 Mbit/s
         16:00    466.05 MiB |  458.45 MiB |  924.50 MiB |    2.15 Mbit/s
         17:00    427.70 MiB |  419.46 MiB |  847.16 MiB |    1.97 Mbit/s
         18:00    427.04 MiB |  418.87 MiB |  845.91 MiB |    1.97 Mbit/s
         19:00    426.49 MiB |  416.87 MiB |  843.36 MiB |    1.97 Mbit/s
         20:00    437.17 MiB |  427.45 MiB |  864.62 MiB |    2.01 Mbit/s
         21:00    395.40 MiB |  388.84 MiB |  784.24 MiB |    1.83 Mbit/s
         22:00    407.39 MiB |  396.83 MiB |  804.22 MiB |    1.87 Mbit/s
         23:00    380.56 MiB |  373.11 MiB |  753.67 MiB |    1.76 Mbit/s
     2022-01-05
         00:00    451.65 MiB |  442.65 MiB |  894.31 MiB |    2.08 Mbit/s
         01:00    381.46 MiB |  374.69 MiB |  756.15 MiB |    1.76 Mbit/s
         02:00    378.04 MiB |  370.87 MiB |  748.91 MiB |    1.75 Mbit/s
         03:00    363.45 MiB |  356.01 MiB |  719.46 MiB |    1.68 Mbit/s
         04:00    356.49 MiB |  349.34 MiB |  705.83 MiB |    1.64 Mbit/s
         05:00    377.99 MiB |  371.14 MiB |  749.14 MiB |    1.75 Mbit/s
         06:00    352.31 MiB |  346.31 MiB |  698.62 MiB |    1.63 Mbit/s
         07:00    431.11 MiB |  395.64 MiB |  826.76 MiB |    1.93 Mbit/s
         08:00    465.50 MiB |  458.15 MiB |  923.65 MiB |    2.15 Mbit/s
         09:00    455.48 MiB |  446.95 MiB |  902.43 MiB |    2.10 Mbit/s
         10:00    420.18 MiB |  410.78 MiB |  830.96 MiB |    1.94 Mbit/s
         11:00    436.60 MiB |  425.22 MiB |  861.83 MiB |    2.01 Mbit/s
         12:00    396.49 MiB |  389.05 MiB |  785.55 MiB |    1.83 Mbit/s
         13:00    426.88 MiB |  419.59 MiB |  846.47 MiB |    1.97 Mbit/s
         14:00    442.89 MiB |  434.94 MiB |  877.83 MiB |    2.05 Mbit/s
         15:00    413.53 MiB |  405.88 MiB |  819.41 MiB |    1.91 Mbit/s
         16:00    534.54 MiB |  428.17 MiB |  962.71 MiB |    2.24 Mbit/s
         17:00    414.62 MiB |  409.14 MiB |  823.76 MiB |    1.92 Mbit/s
         18:00    445.06 MiB |  434.23 MiB |  879.29 MiB |    2.05 Mbit/s
         19:00    445.89 MiB |  437.11 MiB |  883.00 MiB |    2.06 Mbit/s
         20:00    448.30 MiB |  439.51 MiB |  887.81 MiB |    2.07 Mbit/s
         21:00    453.46 MiB |  444.76 MiB |  898.22 MiB |    2.09 Mbit/s
         22:00    445.26 MiB |  437.55 MiB |  882.81 MiB |    2.06 Mbit/s
         23:00    414.49 MiB |  406.97 MiB |  821.46 MiB |    1.91 Mbit/s
     2022-01-06
         00:00    369.23 MiB |  358.24 MiB |  727.47 MiB |    1.70 Mbit/s
         01:00    450.55 MiB |  444.51 MiB |  895.06 MiB |    2.09 Mbit/s
         02:00    357.75 MiB |  352.79 MiB |  710.54 MiB |    1.66 Mbit/s
         03:00    384.89 MiB |  377.52 MiB |  762.41 MiB |    1.78 Mbit/s
         04:00    371.66 MiB |  366.13 MiB |  737.79 MiB |    1.72 Mbit/s
         05:00    358.51 MiB |  353.19 MiB |  711.70 MiB |    1.66 Mbit/s
         06:00    379.24 MiB |  374.63 MiB |  753.88 MiB |    1.76 Mbit/s
         07:00    399.48 MiB |  392.64 MiB |  792.12 MiB |    1.85 Mbit/s
         08:00    392.75 MiB |  386.50 MiB |  779.25 MiB |    1.82 Mbit/s
         09:00    410.97 MiB |  404.59 MiB |  815.55 MiB |    1.90 Mbit/s
         10:00    412.91 MiB |  405.23 MiB |  818.14 MiB |    1.91 Mbit/s
         11:00    397.52 MiB |  390.78 MiB |  788.30 MiB |    1.84 Mbit/s
         12:00    232.13 MiB |  228.34 MiB |  460.47 MiB |    2.15 Mbit/s
     ------------------------+-------------+-------------+---------------