Hacker News new | ask | show | jobs
by ssl-3 11 days ago
With 1, it may be right or wrong, and we can't know one way or the other.

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

[2]: https://www.ntppool.org/en/use.html

1 comments

So, the cool thing about `ntpd` and Chrony is that they do exponential backoff, once they have gathered enough statistical information about the upstream servers they are using. They will typically keep a tighter loop on their selected SYSPEER, but the others will be allowed to relax.

This will reduce the load on any additional upstream time servers that you configure, but obviously it won’t go all the way down to zero.

You still want to be considerate of your neighbors, and not abuse their servers. But it is generally considered fine to be connected to as many as ten upstream time servers.

Now, if you use the “pool” directive, when you get back multiple IP addresses for the same name, you will connect to each of those servers in that pool. If you do the numbered server trick that I explain elsewhere, and each name comes back with just three IP addresses, that means that you will actually be connecting to four or five names, times three IP addresses per name. That’s twelve to fifteen servers, probably.

But that’s okay, because you’re just connecting to the servers you were told about when you did the DNS query, and given the DNS load balancing built into the pool, when the next person asks the same question about those same machines, they will probably get different answers.

Whether it’s `ntpd` or Chrony, when your client goes through the periodic re-evaluation process of those configured upstream time servers, that’s when it should pick up any IP addresses per name changes. And if the IP address is different, then it doesn’t matter that the name is the same. The design of the NTP protocol is such that you must have one and only one unique clock behind each IP address. That’s why load balancing switches don’t work with NTP.

Hey, thanks for the considered response.

I knew about most of that, but I did know about the numbered server addresses being used as multiple peers. You also filled in some other important details that I had glossed over.

I still think it's best to do some local stuff, though, if a large-ish network is resoundingly reliant on tightly-accurate time: Both for the health of volunteer-effort pool, and for the health of the local stuff that needs that timing even as the greater network ebbs and flows.

I have a question, though: What happens when a peer from a pool DNS name drops off and never comes back? Does the local assortment of peers stay relatively-degraded until restart of the daemon, or is there a mechanism that will eventually select a replacement?

If you have your own local Stratum-1 servers that are getting their time source from GPS (or whatever), then yes. You should absolutely use them and “prefer” them.

Once you’ve gotten your local primary servers set up, then all local clients should be configured to use them. Absolutely. Maybe even “prefer” them.

But, in case those local primary servers go down, you may also want your local clients to have backup solutions available to them, and those backups might come from the NTP Pool.

Now, AWS is big enough that they don’t need or want external backups. But that’s probably not the model you want to follow.

If you are operating on AWS, then the Amazon Time Sync Service that they provide will give you a better quality of time, with a better SLA, than you can get anywhere else. Especially if you’re on the newer hardware which has access to the proprietary 1PPS fabric. You definitely want to “prefer” that. But even on AWS, you may decide that you want to have backups available to you, and those might come from the NTP Pool.