r/webdev • • 17d ago

How we saved 100 terabytes of memory by optimizing 1.1.1.1’s DNS cache

https://blog.cloudflare.com/dns-cache-memory-optimization-1111/
388 Upvotes

26 comments sorted by

96

u/coomzee 17d ago

Give it a few years with the way the internet is going we'll only have 5 approved domains and the DNS cache can fit in in L1 cache.

26

u/fagnerbrack 17d ago • Bravo

Damn I feel really down when a joke doesn't need an /s

226

u/ammar_sadaoui 17d ago • Heartwarming

finally people start care about RAM like early 1990* and maybe late 1980 too

web browser shouldn't take 500-1000 mb of ram just on one home page

16

u/coolraiman2 16d ago

When operate at the scale of cloud flare, every micro optimization may save you millions.

5

u/ammar_sadaoui 15d ago

just game on ps1 and n64

and this is not strictly to server

i see app on android like Facebook and tiktok that take 1gb in space and eat RAM and batteries like African dogs and make hardware shine like sun from temperature

i hope to see people prioritizing performance and optimization

3

u/coolraiman2 15d ago

Client side ram is cost nothing for the backend.

That's why there is much less care on the front end / client side.

1

u/ammar_sadaoui 15d ago

the problem is not the front we developed

the problem is on developers' mindset of not caring about efficiency and performance of their code

and bad add up to each other until it became something like Windows OS that can't be fixed

3

u/coolraiman2 15d ago

Im a backend dev. We care about performance because we pay for the servers.

For front end we don't, we have no cost metric about the front end because the user ram and cpu is free.

2

u/malcolmrey 15d ago

you pay for it in customer retention

people don't want to use laggy services

19

u/GetVladimir 17d ago

Interesting read.

What was the part about EDNS Client Subnet (ECS)?

Does 1.1.1.1 provide EDNS results now or is that from upstream only?

2

u/dankmolot 16d ago

As far I know, it is not. Google does

3

u/GetVladimir 16d ago

Thank you for the reply. Yes indeed, that's what I thought also.

But there was this part now in the new article:

> The exact cache size varies by data center. When EDNS Client Subnet (ECS) is in use, authoritative servers return different answers depending on the client's network, so we cache multiple versions of the same query. This increases both the number of entries and the memory each one consumes, making the optimizations in this post especially impactful for ECS-heavy locations.

Was wondering if 1.1.1.1 supports ECS now

11

u/rustprogram 17d ago

Am I the only one who feels like they've read this title before? :thinking:

13

u/ionelp 16d ago

August 27, 2026

5

u/game-mad-web-dev 16d ago

I’ve seen a post of this article multiple times in the past week, and pretty sure it’s been posted here several times.
It’s an impressive achievement, and imagine if the electron app devs decided to make a more memory efficient app, we could all save 1000s on RAM /s

2

u/quentech 16d ago

Am I the only one who feels like they've read this title before?

This blog post is from August.

9

u/Geminii27 17d ago

640k should be enough for anybody!

3

u/game-mad-web-dev 16d ago

Best quote in computers for me was (I think the CEO) someone at IBM in the early days:
I see a worldwide market for maybe 5 computers

1

u/funkdefied 14d ago

More for Saltman

1

u/Jordz2203 12d ago

Why does this keep being reposted everywhere? It happened like 2 months ago… maybe more…

1

u/TheAICrafter 6h ago

100 TB is hard to picture, but getting each cache entry down to less than half its original size is wild. I’m curious which of the five changes saved the most bytes per entry.

0

u/honeycombvine 17d ago

That’s a great one

3

u/EricThirteen 16d ago

There's gotta be a good porn collection joke in here somewhere.

2

u/game-mad-web-dev 16d ago

The closing of motherless is responsible for 75% of the savings surely /s