Live data from Hacker News

Benchmarking DNS response times of TLDs

bunnycdn.com

131–140 of 141 posts

Re: Benchmarking DNS response times of TLDs

#131
post #5

This is one of those things you simply don't expect to test when you're benchmarking performance. I've been trying to cut away chunks of 20-50ms on a side project I've been working on hosted on a .io domain, and I'm seriously considering switching because of this. Great article for sure. I also wonder at what point the trade off is between a vanity domain vs a more performant domain. For a CDN this makes perfect sens…

Switch to .dev then? It's not listed on this graph but its performance should be similar to .app.

Disclaimer: I run .dev.

Re: Benchmarking DNS response times of TLDs

#132
post #125

Earlier quoted context omitted.

> rel=dns-prefetch This is amazing! How could I have missed this? How are the loading times affected when using this option, if you care to share?

Beware even some text-only browsers have added prefetching; need to patch source to turn it off And then there are browsers that have internal stub resolver. Horrible https://www.reddit.com/r/chrome/comments/bgh8th/chrome_73_di... https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-... https://www.chromium.org/developers/design-documents/dns-pre... https://www.ghacks.net/2019/04/23/missing-chromes-use-a-pred.…

> And then there are browsers that have internal stub resolver.

You mean internal caching resolver? Every application has an internal stub resolver, even if it's just using getaddrinfo, which builds and sends DNS packets to the recursive, caching resolvers specified by /etc/resolv.conf or equivalent system setting. But getaddrinfo is blocking, and various non-portable extensions (e.g. glibc getaddrinfo_a, OpenBSD getaddrinfo_async) are integration headaches, so it's common for many applications to include their own async stub resolver. What sucks is if an internal stub resolver doesn't obey the system settings.

Re: Benchmarking DNS response times of TLDs

#133
post #5

This is one of those things you simply don't expect to test when you're benchmarking performance. I've been trying to cut away chunks of 20-50ms on a side project I've been working on hosted on a .io domain, and I'm seriously considering switching because of this. Great article for sure. I also wonder at what point the trade off is between a vanity domain vs a more performant domain. For a CDN this makes perfect sens…

> For a CDN this makes perfect sense I'd say the inverse is more likely. If you're going to fire a single request to a domain only you are using and you're running a full local resolver, it may make a difference. For a public CDN: your browser already has the file cached. If it doesn't then it has the domain cached. If it doesn't then the dhcp-provided resolver has it. If it doesn't, then at least it already has the…

With a vanity domain, you can fully control the TTL values. All my sites use a vanity domain because it doesn't tie me to a particular CDN, and they have 86400 TTL.

When you have a vanity domain like cdn.example.com, the recursive resolver already knows the nameservers for example.com, so this actually reduces the additional DNS lookups.

Re: Benchmarking DNS response times of TLDs

#134
post #132
post #125

Earlier quoted context omitted.

Beware even some text-only browsers have added prefetching; need to patch source to turn it off And then there are browsers that have internal stub resolver. Horrible https://www.reddit.com/r/chrome/comments/bgh8th/chrome_73_di... https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-... https://www.chromium.org/developers/design-documents/dns-pre... https://www.ghacks.net/2019/04/23/missing-chromes-use-a-pred.…

> And then there are browsers that have internal stub resolver. You mean internal caching resolver? Every application has an internal stub resolver, even if it's just using getaddrinfo, which builds and sends DNS packets to the recursive, caching resolvers specified by /etc/resolv.conf or equivalent system setting. But getaddrinfo is blocking, and various non-portable extensions (e.g. glibc getaddrinfo_a, OpenBSD get…

As a user, I prefer gethostbyname to getaddrinfo. The text-only browser I use actually has --without-getaddrinfo as a compile time option, so I know I am not alone in this preference. The best "stub resolvers" are programs like dnsq, dq, drill, etc. They do not do any "resolution", they just send queries according the user's specification.

As a user, I expect that the application interfacing with the resolver routines provided by the OS will respect the configuration settings I make in resolv.conf. Having to audit every application for how it handles DNS resolution is a headache.

https://www.xda-developers.com/fix-dns-ad-blocker-chrome/

I recall there were earlier experiments with internal DNS resolution in Chromium, e.g., code was added then removed.

Browser DNS caches are another annoyance but that is not what I meant.

Re: Benchmarking DNS response times of TLDs

#135
post #7

Earlier quoted context omitted.

I humbly suggest this is not a good use of your time.

nope I would kill to be able to cut 50ms by DNS tweaks across the large fleet >100 sites for a major brand

If you haven't done already, take a look at don't delivery improvements. Serve don't files locally, subset them, and use variable fonts and woff2. I'm a micro performance enthusiast myself and it's my #1 optimization with the biggest gain.

Re: Benchmarking DNS response times of TLDs

#136
post #134
post #132

Earlier quoted context omitted.

> And then there are browsers that have internal stub resolver. You mean internal caching resolver? Every application has an internal stub resolver, even if it's just using getaddrinfo, which builds and sends DNS packets to the recursive, caching resolvers specified by /etc/resolv.conf or equivalent system setting. But getaddrinfo is blocking, and various non-portable extensions (e.g. glibc getaddrinfo_a, OpenBSD get…

As a user, I prefer gethostbyname to getaddrinfo. The text-only browser I use actually has --without-getaddrinfo as a compile time option, so I know I am not alone in this preference. The best "stub resolvers" are programs like dnsq, dq, drill, etc. They do not do any "resolution", they just send queries according the user's specification. As a user, I expect that the application interfacing with the resolver routine…

> As a user, I prefer gethostbyname to getaddrinfo

On many systems (e.g. OpenBSD) they're implemented with the exact same code. glibc is something of an outlier given its insanely complex implementations interacting with RedHat's backward compatibility promises. Many of the code paths are the same[1], but getaddrinfo permits stuff like parallel A and AAAA lookups, and minor tweaks in behavior (e.g. timing, record ordering) often break somebody's [broken] application, so I'm not surprised some people have stuck to gethostbyname, which effectively disables or short-circuits alot of the optimization and feature code.

But, yeah, browsers in particular do all sorts of crazy things, even before DoH, that were problematic.

[1] As a temporary hack to quickly address a glibc getaddrinfo CVE without having to upgrade (on tens of thousands of deployed systems) the ancient version of glibc in the firmware, I [shamefully] wrote a simple getaddrinfo stub that used glibc's gethostbyname interfaces, and dynamically loaded it as a shared library system wide. It worked because while most of the same code paths were called, the buffer overflow was only reached when using getaddrinfo directly. Hopefully that company has since upgraded the version of glibc in their firmware. But at the time it made sense because the hack was proposed, written, tested, and queued for deployment before the people responsible for maintaining glibc could even schedule a meeting to discuss the process of patching and testing, which wasn't normally included in firmware upgrades and nobody could remember the last time they pushed out rebuilt binaries. glibc was so old because everybody was focused on switching Linux distributions, which of course took years to accomplish rather than months.

Re: Benchmarking DNS response times of TLDs

#137
post #136
post #134

Earlier quoted context omitted.

As a user, I prefer gethostbyname to getaddrinfo. The text-only browser I use actually has --without-getaddrinfo as a compile time option, so I know I am not alone in this preference. The best "stub resolvers" are programs like dnsq, dq, drill, etc. They do not do any "resolution", they just send queries according the user's specification. As a user, I expect that the application interfacing with the resolver routine…

> As a user, I prefer gethostbyname to getaddrinfo On many systems (e.g. OpenBSD) they're implemented with the exact same code. glibc is something of an outlier given its insanely complex implementations interacting with RedHat's backward compatibility promises. Many of the code paths are the same[1], but getaddrinfo permits stuff like parallel A and AAAA lookups, and minor tweaks in behavior (e.g. timing, record ord…

As a user, I admire your work.

Re: Benchmarking DNS response times of TLDs

#138
post #107
post #70

Earlier quoted context omitted.

It's worth making it exist and doing a 301 redirect. There's some people that will still type it, and others that will link it without checking, and they'll just think your site is broken. You're fighting against the grain for what's essentially a couple lines of config. It's not much different than using TLS for everything, but still handling and redirecting http:// traffic (also doing a 301 redirect).

It's also useful to set hsts for the whole domain. I'm opinionated enough to say if you type http://example.org/foo , I'm just going to redirect that to https://www.example.org/ but reasonable people could disagree (especially since Chrome has been going back and forth on displaying the actual URL and something that's vaguely similar to it)

That would just be a giant middle finger to people who manually type URLs.

Re: Benchmarking DNS response times of TLDs

#139

Friendly reminder for people on HN reading this: I know this is actually quite interesting, but before you start worrying about the latency of the name servers of your TLD, you might want to do something about the metric ton of JavaScript on your site and the 25 different 3rd party servers from which you side load most of it. Also those 6 additional servers from which you load a bunch of TTF fonts. Especially if all…

And if they weren't using 60 second TTLs everywhere, they might actually from the caching built into DNS!

Re: Benchmarking DNS response times of TLDs

#140
post #135

Earlier quoted context omitted.

nope I would kill to be able to cut 50ms by DNS tweaks across the large fleet >100 sites for a major brand

If you haven't done already, take a look at don't delivery improvements. Serve don't files locally, subset them, and use variable fonts and woff2. I'm a micro performance enthusiast myself and it's my #1 optimization with the biggest gain.

dont't ??

I will have a look at your font suggestions

Post reply on HN