Live data from Hacker News

Stop using low DNS TTLs

blog.apnic.net

21–30 of 46 posts

Re: Stop using low DNS TTLs

#21
post #8

Could it be because folks set it low for initial propagation and then never change it back after they set it up.

Maybe, but I don't think TTL matters for speed of initial propagation. I do set it low when I first configure a website so I don't have to wait hours to correct a mistake I might not have noticed.

Yes. Statistically the most likely time to change a record is shortly after previously changing it. So it is a good idea to use a low TTL when you change it, then after a stability period raise the TTL as you are less likely to change it in the future.

Re: Stop using low DNS TTLs

#23
post #2

I don't understand why the author doesn't consider load balancing and failover legitimate use cases for low ttl. Cause it wrecks their argument?

Because unless your TTL is exceptionally long you will almost always have a sufficient supply of new users to balance. Basically you almost never need to move old users to a new target for balancing reasons. The natural churn of users over time is sufficient to deal with that.

Failover is different and more of a concern, especially if the client doesn't respect multiple returned IPs.

Re: Stop using low DNS TTLs

#24
post #2

I don't understand why the author doesn't consider load balancing and failover legitimate use cases for low ttl. Cause it wrecks their argument?

Because unless your TTL is exceptionally long you will almost always have a sufficient supply of new users to balance. Basically you almost never need to move old users to a new target for balancing reasons. The natural churn of users over time is sufficient to deal with that. Failover is different and more of a concern, especially if the client doesn't respect multiple returned IPs.

I'm assuming OP means cloud-based load balancers (listening on public ips). Some providers scale load balancers pretty often depending on traffic which can result in a set of new IPs.

Re: Stop using low DNS TTLs

#25
post #2

I don't understand why the author doesn't consider load balancing and failover legitimate use cases for low ttl. Cause it wrecks their argument?

Why do you need a low ttl for those? You can add multiple IPs to your A/AAAA records for very basic load balancing. And DNS is a pretty bad idea for any kind of failover. You can set a very low ttl, but providers might simply enforce a larger one.

What if your site is slashdotted or HN hugged to death? Most requests will hit the IP of the first record, while the others idle.

Re: Stop using low DNS TTLs

#26

(2019)

Discussed in 2022 (106 comments) https://news.ycombinator.com/item?id=33527642

And a similar version of the same blog post on a personal blog in 2019 https://news.ycombinator.com/item?id=21436448 (thanks to ChrisArchitect for noting this in the only comment on a copy from 2024).

Re: Stop using low DNS TTLs

#27
I used to get more excited about this but even when browsers don't do a DNS prefetch (or even a complete preload) the latency for lookups is usually still so low on the list of performance impacting design decisions that it is unlikely to ever outweigh even the slightest advantages (or be worth correcting misperceived advantages) until we all switch to writing really really REALLY optimized web solutions.
Post reply on HN