Cloudflare Reduces DNS Cache Memory Usage by 100 Terabytes Across Global Network
Cloudflare optimized the DNS cache memory layout of its 'Big Pineapple' resolver service, reducing memory usage per entry by 56% and reclaiming 100 terabytes of memory globally.

Cloudflare has detailed five Rust-level memory layout optimizations applied to the DNS cache of its 1.1.1.1 public DNS resolver service, internally known as Big Pineapple. By redesigning how cache entries are stored in memory, engineers managed to cut per-entry memory consumption by 56 percent. This optimization successfully freed approximately 100 terabytes of RAM across Cloudflare's entire global server fleet.
Primary source
Open Cloudflare Blog ↗This article summarizes the source. Check the original for full details and conditions.
Comparison
| Aspect | Before / Alternative | After / This |
|---|---|---|
| Per-entry memory footprint | Higher memory consumption due to unoptimized Rust layout | Reduced by 56% through field reordering and optimized types |
| Global fleet memory usage | 100 TB more RAM consumed by DNS cache entries | 100 TB of RAM reclaimed for other system processes |
| Cache layout design | Standard structures with padding overhead | Compact Rust-level memory alignments and optimized pointers |



