How we saved 100 terabytes of memory by optimizing 1.1.1.1’s DNS cache
- ID
- 18686
- Status
- summarized
- Published
- 28 Aug 2026, 1:02 AM
- Fetched
- 28 Aug 2026, 1:51 AM
- Provider
- Cloudflare Blog
- Category
- infrastructure
- Original URL
- https://blog.cloudflare.com/dns-cache-memory-optimization-1111/
- Source URL
- https://blog.cloudflare.com/rss/
Summary
- Score
- 8.0
- Created
- 28 Aug 2026, 1:52 AM
- Tags
- Audience
- developersdatabase_learnerssaas_founders
What happened
Cloudflare optimized the Rust-based DNS cache for its 1.1.1.1 resolver (Big Pineapple platform), which stores over 250 billion entries. By making five changes to how cache entries are stored in memory, they reduced the per-entry footprint by over 50%, saving 100 TB of RAM across their fleet. These optimizations also improved performance, with insert throughput rising 43% and lookup latency dropping 19%.
Why it matters
For developers building high-throughput caching systems in Rust, this post demonstrates how reducing struct field overhead and improving memory locality can yield massive cost savings and performance gains simultaneously. Builders should evaluate their own cache key and value structs for bloated types when operating at extreme scale.
Discussion angle
How to profile and optimize Rust struct memory layouts for large-scale caching, balancing memory footprint against CPU performance.