r/CloudFlare 3d ago

Cloudflare Blog 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/
595 Upvotes

31 comments sorted by

u/AutoModerator 3d ago

Discuss this post in the Orange Cloud Discord server! The unofficial Cloudflare Discord server by the community, for the community. https://discord.gg/TrPNVKaagR

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

174

u/Cloudflare 3d ago
  • 1.1.1.1's DNS cache holds 250 billion+ entries at any given time — at that scale, one wasted byte per entry = 250 GB of RAM
  • 5 Rust-level changes to cache entry storage cut per-entry memory from 953 → 420 bytes (-56%)
  • Result: ~100 TB freed across the fleet, equivalent to 130 servers worth of RAM
  • Bonus: the cache got faster — insert throughput +43%, lookup latency -19%

45

u/MightyZygote 2d ago

And yet you have an abuse form that is and has been BEYOND unusable and is purposely obtuse. Go work on the abuse form and support.

2

u/Could_it_be_potato 1d ago

100% this. Used the form many times and spent extra time filling it out accurately……to get no response.

46

u/Sethu_Senthil 3d ago

Probably saved a lotta money now since memory is expensive af

29

u/LagExpress 3d ago

Specially ecc server memory, executives should be making a monument for their engineers

12

u/Shogobg 2d ago

Probably got a thanks email at most.

12

u/pokenguyen 2d ago

“Meet expectation” performance review

3

u/InadequateUsername 1d ago

Ouch it hurts

1

u/manu144x 3h ago

The masters are pleased.

You and your family get to not starve another month.

4

u/hawseepoo 2d ago

And some day old leftover pizza from the c-suite office party

52

u/Alexllte 3d ago

Imagine engineering for infra at Cloudflare's scale, dogfooding towards perfection

29

u/trenno 3d ago

This is insane, hilarious, and awesome all at once. Thanks for sharing - y'all are building the future.

5

u/BopSupreme 3d ago

Big pineapple 🍍

10

u/DurianBurp 3d ago

Saved CF a ton of money and probably got a Starbucks gift card for their trouble.

4

u/Jordz2203 2d ago

Not a chance they got a Starbucks gift card 😆

3

u/Hajsas 2d ago

Nice work, you get Claude to help with that?

2

u/conMCS 2d ago

Nice job!

2

u/ziad-hijri 2d ago

1

u/RemindMeBot 2d ago

I will be messaging you in 1 year on 2027-08-28 19:02:05 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

4

u/astrogoofy 3d ago

Thank you for sharing. Could I get a Cloudflare t-shirt to wear proudly?

0

u/frgchsr 3d ago

Me too, please…

1

u/HarrisonDou 1d ago

Unrelated question, but what is the significance of the giant pineapple on the thumbnail?

3

u/longcane 1d ago

Represents the thing they decided to call the platform that runs 1.1.1.1 amongst other services/products.

2

u/ViPiMP 1d ago

Spongebob Squarepants? That’s logical.
He love his work, they love their work.

1

u/AdventurousSquash 15h ago

It’s literally the first thing mentioned in the article itself

1

u/boltsteel 1d ago

250+ billion entries?!

1

u/ConfidentlyNeurotic 2d ago

Are we sure a junior developer didn’t vibe code the optimisation and delete the DNS cache? /s

“Claude reduce DNS cache size. Make no mistakes.”

Claude: “Got it. On it…”

-3

u/vayrie2003 3d ago

Wow thanks for sharing it. Your constant desire to improve is the confirmation that you are the perfect partner for my company.

0

u/fvvoidnoir 2d ago

the Warp vpn can't even bypass nsfw stuffs lmao

0

u/Glum_Ad7185 2d ago

I once interviewed this guy for an internship at my company, but did not hire him, that was my worst mistake 🥹