157 points | 17h ago | Discuss on Hacker News | Back to Radar
Anyways, I use NTPSec- which is the default these days on Debian when you apt-get install NTP. I’ve not tried Chrony, but I see it mentioned all the time.
I’m curious what others here are running and their thoughts on the pros and cons?
Edit: I forgot to add, one of my favorite parts of being in the pool is basically a free uptime monitor of my ISP. There have been multiple cases where I see a blip in my offset then a full blown ISP outage within 78 hours of the blip, then a return to my normal offsets after to outage has resolved.
There are also a lot of people who buy old Spectracom or other 'enterprise' time servers since they can be had for low hundreds of dollars with some nice features like rubidium or OCXO oscillators, so they can hold over time much more accurately when GPS is down, or upstream NTP providers are unreachable.
And regarding chrony, it's the default in many distros now, I like some of its built-in monitoring and clock adjustments, it just feels easier to manage if you want more than just base NTP features. It also supports hardware timestamping if you have network hardware that has it, which IIRC NTPd doesn't? I haven't messed with systemd-timesyncd or ntpd-rs, so can't say much on them.
But if you have any questions on this, I can ask my friend Harlan.
Although I looked at that page and didn’t see anything about whether or not it was okay to use an NTP,server running under a VM.
I will contact Ask Bjørn Hansen about this.
Heiko is now the CEO of that company. I got to see his face in person for the first time a few years ago, when I was working on the EC2-Chronos team at AWS, and we were considering bringing in Meinberg as one of our preferred vendors of Primary Time Appliances, with a goal to install them at each and every AWS datacenter around the world.
That effort was part of the enhanced version of the Amazon Timekeeping Service that we officially launched in 2023, and highlighted as part of the Re:Invent keynote that Peter DeSantis did (see: https://www.youtube.com/watch?v=pJG6nmR7XxI). Originally, the SLA was accuracy within one millisecond, but with this project, we got that down to 20 microseconds.
Internally, AWS uses Chrony. Both on the back-end Stratum-2 time servers, and we also controlled the default Chrony configuration on all of the EC2 instances. And I so got familiar with doing chronyd configurations.
I think it’s fine for that purpose, but I would make sure that you’re not doing leap second smearing. I know the leap second is going away, but the last time I checked with Ask Bjørn Hansen, he did not allow any time servers into the pool if they were doing leap smearing. Which is why we could operate our own time.aws.com service, but we couldn’t contribute time servers to the NTP Pool, because all of our servers did leap smearing.
Ironically, during the time I was actively working to support NTP.org, I helped Ask Bjørn Hansen to set up the NTP Pool, but it has been years since I talked to him about it. I should reconnect with him.
Over the past few weeks I bumped it up to 50, then 100, and now it's at 250 Mbit. At 100 Mbit I was seeing 180-250 requests/sec. At 250 (just switched earlier this morning) I'm seeing 500-600 requests/sec.
I'm monitoring things on the server with chronytop[1], a tool I whipped up with Claude since I didn't see any other concise dashboards and hated `watch`ing chronyc sources to get any kind of updated data.
My server (which is in the ipv4 @/NA/US pools at 12mbit) is seeing 250 requests/sec, measured across the 57th minute. (If I measured the 00'th minute it'd spike due to top-of-the-hour SNTP requests in the crontabs of the world). It's been in the pool at that IP for years now.
If it runs well, I may move a couple other services to Oxtrys, or see if I could colocate a machine or two in Contabo's DC.
METAS is the Federal Institute of Metrology.
However using a pool is the better way IMHO.
Or go Stratum 1 via DCF77 https://zeit.ptb.de/
NTP server: time.nrc.ca but use a pool instead
In general Pi-s are relatively bad for timekeeping. Not just the NIC (which can be replaced by hats with their own), there are also oscillator replacement mods[2] to work around this to some extent. Though all this still leaves many other sources of timekeeping error.
So if the goal is low-cost precise timekeeping, one can assemble something FPGA-based[2] for quite a bit less money, that can reach very low noise figures. You can spend the remaining money on the GNSS antenna and receiver instead.
I'm also sure a FPGA-based approach could be taken even further with some external timekeeping chips available and the FPGA could just do the NTP/PTP protocol stuff.
[0]: https://www.youtube.com/watch?v=zxK0_j2Ah2I [1]: https://raspberrypi.stackexchange.com/questions/74482/switch... [2]: https://fy.chalmers.se/~f96hajo/fakernet/board_Arty_A7-35-GP...
If you want to chase lower, you need a hardware-disciplined clock. Either through FPGA, or in the case of my Time Pi, I have a PTP NIC with a PHC disciplined from the ublox F9T—which should be within 5-20ns of GPS time. This can be measured on higher-end boards like the TimeHAT by comparing PPS out from the GNSS module, PPS from the NIC, and PPS from a separate GPSDO, along with a timestamp comparison tool like the tinyGTC or TAPR TICC: https://tapr.org/product/tapr-ticc/
The annoying thing is there are few PC hardware combos that include the relevant PPS and frequency outputs to allow actual verification of your time in hardware. Software can show numbers but even on my Pi dashboard, the sub-20ns sync reported is between the system clock and the NIC PHC... but not currently accounting for the delay when the kernel reads the PHC over PCIe.
Pi could support PTM on its PCIe bus, that would be awesome. Overkill for 99.9% of its market though!
In 2002, he got the error band down to 260 nanoseconds, see: https://phk.freebsd.dk/soekris/pps/
He has done better since then.
[1] https://github.com/geerlingguy/raspberry-pi-pcie-devices/iss...
[2] https://github.com/Time-Appliances-Project/TimeHAT#intel-i22...
chrony says this, but unsure if this is then even valid?
#* GPS 0 -2 20 2 +11ns[ +23ns] +/- 780nsAnd have yet _another_ GNSS dependent NTP server?
At least use a LW time signal for a change (assuming you can't aford your own rubidium clock)!
I wonder why the wall clock on top is 10 seconds ahead of the bottom one?
I have a solution to that I'm working on—Pico W that grabs time from NTP then broadcasts about 1m with a tiny antenna so I can set my wall clock and watch (the one with the green band in the picture).
One annoying side effect of running faster is whenever the clock gets a correction, since the gears only run forward, the clock has to go all the way around almost 12 hours to get back to the corrected time after a sync.
can it not just stop the clock for a sec?
It could be the received signal was so bad in Florida (or without error-checking) that the clock made up an invalid time that it was impossible for it to sync to.
I'd therefore recommend against synced analog time, and against WWVB (unless you live in Colorado).
Speaking of that, do you have a list somewhere of your gear, specifically those three digital clocks (or maybe they're just essentially displays)?
Thank you for the article!
But in order from top to bottom:
PTP Wallclock (yellow matrix display), running Oliver Ettlin's software I found out about through a CCC talk on PTP
Masterclock NTDS (unlisted on their site, but they still make these for broadcast) 'analog-style' digital NTP clock
Mitxela Precision Clock Mk4 (gets time straight from GPS, displays accurate time to the ms, though you need a high speed camera to see it).
The two wall clocks are a radio time clock from La Crosse I found at Micro Center (up top), and an OCEST WiFi NTP clock.
Also, I swear I read all of those digital clocks, saw :28, and thought :38. Clearly I don't need accurate time if I can't be bothered to read properly!
I've commented here before that the WWVB clocks are mostly useless in Florida. Others have suggested spoofing the signal. It seems better to cut out the middleman and go direct to GNSS or at least (and probably easier) NTP.
I still personally wouldn't try to run an NTP server on a VM unless I also owned/controlled the bare metal hardware the hypervisor is running on.
Some decent discussion on this topic (though with broken links to a separate NTP Pool discussion) here: https://a.osmarks.net/content/serverfault.com_en_all_2022-11...
But it is possible that Ask Bjørn Hansen has changed his mind. I bet if you look on their website at ntppool.org, you should find an answer.
Thanks a lot for sharing knowledge!
Issues included unresponsive servers, and servers handing out time that was days/weeks/months out of realtime.
With 2, we still never know if one is correct. This is about the same as 1 but with more steps.
With 3, we gain some good certainty[1].
With 4, there can be further-improved consensus and also redundancy (stuff can and will break). 4 is what the pool suggests[2] using.
With 5 or 6 or more, we're getting into rapidly-diminishing returns while linearly increasing load on the pool. If the time is critical enough to whatever you've got going on to go that far, it may be best to start rolling one's own infrastructure if for no other reason than to reduce impact and be a good neighbor.
(Setting up a networked timeserver (I'm most familiar with ISC ntpd) to distribute network time locally is easy, and is a light-weight process for non-gargantuan networks. Learning about and adding locally-received GPS is still optional, but it's in the realm of spending afternoon with a Raspberry Pi or something along with an inexpensive GPS module.)
[1]: https://en.wikipedia.org/wiki/Triple_modular_redundancy
However, during my time working on the EC2-Chronos team that managed all NTP time servers for all of AWS and Amazon worldwide, in every single region, availability zone, and datacenter, I learned the old rules aren’t quite right.
Ultimately, the NTP algorithm works something like this:
1. Get a statistically significant set of time samples for each upstream time server. That will give you a range of time that it looks like the upstream time server is sending to you, and what you can’t really control is the latency, jitter, wander, etc… that is induced by the network between you. You can measure and account for some of what the network does to you, but not all of it. That’s why you get error bars back.
2. Take the median for each upstream time server, plus the error bars, and plot that on a line. Fastest at one end, slowest at the other.
3. Do some calculations to figure out what the median value is for all of these time servers.
4. If you have more than a selected number of servers on that line, it selects the one that is furthest from the median and throws it out.
5. Then recalculate the new median. If you are now down to three timeservers on that list (or whatever you have configured), then take the one closest to that median and it becomes your SYSPEER. That’s the server you will sync yourself to, since it seems to have the best idea of what the “real” time should be.
6. If you still have servers that can be “voted off the island”, then go back to step #4.
7. Periodically re-evaluate the servers you have configured and which one should be your new SYSPEER.
Now, this assumes you don’t have a local refclock attached (e.g., GPS). If you do, then you probably “PREFER” it over everyone else.
The idea here is that each server that gets voted off the island is potentially a false ticker that is trying to get you to choose the wrong SYSPEER. So, make sure you have enough extra servers defined in your configuration file to survive having a number of falstickers and still get to the right answer. Or, at least one that is close enough.
Historically, the limit was ten upstream timeservers. Any more than that, and `ntpd` would still monitor them, but wouldn’t use them for selecting a SYSPEER. You could monitor up to about 600 upstream timeservers this way, and IIRC, this is actually how the early versions of the NTP Pool operated. You can now adjust how many time servers you want to use for that consideration, but if everyone did this, then it would be chaos. So, you do need to restrict yourself to a reasonable number of upstreams.
More recent NTP servers (e.g., Chrony) will actively use a more upstreams if you configure them, but again you should be courteous to your neighbors and not abuse this feature.
Another trick you can use is to select numbered time servers inside of each NTP Pool zone. So, not just “us.pool.ntp.org”, but also “0.us.pool.ntp.org” and “1.us.pool.ntp.org” and “2.us.pool.ntp.org” and “3.us.pool.ntp.org”. If you were to choose all five of these names, each one will come back with multiple IP addresses, and you should have way more upstream time servers defined than you will ever need.
You should also choose upstream servers and zones that are relatively close to your topological location, where possible. So, don’t choose any upstream servers in Europe or Asia, if you are located in the US. And so on.
Some vendors have signed up to have their own subdomains under the NTP Pool. So, you could add them as time servers for your machine, if you’re on one of those platforms. And they usually have numbered subdomains as well.
If you are an Amazon or AWS customer, then you can also use time.aws.com as one of your upstream time servers. That service was designed to serve all Amazon and AWS customers, worldwide. Every Kindle. Every Alexa device. Every Ring camera. And there are numbered subdomains under time.aws.com, too. I made sure those were created, based on my own experience in helping to set up the NTP Pool and in talking to Ask Bjørn Hansen.
Of course, Apple and Google run their own time server infrastructures. So, you can use them, as well as the NTP Pool. And plenty of other vendors also run their own time server infrastructures.
I’ve been doing this off and on for over twenty years. I can keep going, if you want. Feel free to ask me anything related to NTP.
The parts are under 50 bucks, an esp32p4 with ethernet (and poe) by Waveshare and an m8T module from ali (or fleabay) for $20.
https://github.com/mianos/esp32-p4-Ethernet-NTP-Server
It has a matching ui fed from the REST interface that shows little coloured lights, the satellites and graphs.
Supports ipv6, ipv4 ntp, and ptp.
What I did lately is point a klunker at everyone else's try at the same thing and asked it whose is better, then, if possible made mine the same.
edit: I agree, adding an fpga would allow me to vastly improve the timing. I have to go to all lengths to get the timing on one CPU and everything else on another.
Comments are loaded live from Hacker News and are not stored by Mid or Real.