INFRA Signal 678 2 feeds carried it
How we saved 100 terabytes of memory by optimizing 1.1.1.1’s DNS cache
Five Rust-level memory optimizations to Big Pineapple's DNS cache layout cut per-entry memory by 56%, freeing approximately 100 TB of memory across Cloudflare's fleet.
For systems operating at massive scale, minor per-entry memory overhead translates to massive fleet-wide waste. These optimizations not only reclaimed 100 TB of RAM but also improved cache insert throughput by 43% and reduced lookup latency by 19%. The approach demonstrates that immutable data structures can leverage more compact memory representations without sacrificing performance.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
Cloudflare's Big Pineapple platform stores over 250 billion DNS cache entries, making single-byte inefficiencies costly at scale.
Replacing mutable Rust types like Vec and String with immutable Box types saved 64 bytes per entry and eliminated excess heap allocations.
Consolidating separate DNS record sections into a single list with offsets saved an additional 28 bytes per entry.
THE CLUSTER
↗