Urgent.News

What's breaking now, across thousands of outlets.

Tech

Cloudflare Cuts 100 TB of Memory from 1.1.1.1 DNS Cache

Cloudflare redesigned the in-memory representation of its Big Pineapple DNS cache, reducing the per-entry footprint by 56% and freeing roughly 100 TB of working-set memory across its fleet. The Rust-based changes also increased cache insertion throughput by 43% and reduced lookup latency by 19%, while enabling Cloudflare to increase cache capacity without additional memory. By Leela Kumili

Cloudflare has streamlined the in-memory design of its 1.1.1.1 DNS resolver, trimming memory usage by roughly 100 terabytes. The changes to Big Pineapple, the DNS platform, boosted cache insertion speed by 43% and shaved 19% off lookup times. Big Pineapple manages over 250 billion DNS cache entries. Cloudflare engineer Sebastiaan Neuteboom described the achievement, noting it's rare to save 100 terabytes of memory.

The project entailed five iterative adjustments to cache representation in Rust. The team replaced Vec and String with Box[T] and Box[str] for fixed data post-insertion, saving 64 bytes per entry and over 15 TB across the fleet. They also merged answer, authority, and additional records into a single list with compact offsets, employed packed Booleans in bitflags, and excluded owner names matching the queried domain, reconstructing them from the cache key.

The most significant hurdle was working with Rust enums; initially, larger variants were boxed, but separate allocations added overhead and diminished memory locality. Cloudflare's final design stores record data in a contiguous byte buffer using DNS wire format, eliminating the enum and per-record allocation overhead while enhancing locality.

Frequently used record types can also be copied straight into responses, though records containing domain names still necessitate parsing for DNS name compression. Cloudflare's DNS cache now stores record data as a contiguous byte buffer using DNS wire format. This differs from other recursive DNS resolver caching architectures, such as Unbound's separate message, RRset, key, and negative caches with configurable sizes, and PowerDNS Recursor's multiple cache types, including packet and record caches.

Cloudflare's focus is on minimizing representation and allocation overhead within individual cache entries. The optimization was deployed across production between May 18 and July 6, 2026. Post-implementation, p99 resident memory per instance dropped from 9.3 GB to 5.3 GB, while p90 memory decreased from 6.5 GB to 3.8 GB. Benchmarks revealed the per-entry footprint shrank from 953 to 420 bytes, and allocations reduced from 1.1 KB to 461 bytes.

Insertion throughput increased by 43%, and lookup latency fell by 19%. The overall memory usage across the fleet shrank by roughly 100 TB, memory Cloudflare intends to employ to enlarge cache capacity without escalating total memory consumption.

Written by urgent.news from InfoQ's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at infoq.com →

More in Tech

Security updates for Wednesday

Security updates have been issued by AlmaLinux (coreutils, postgresql18-postgis, and postgresql:16), Debian (memcached), Fedora (chromium, cyrus-imapd, dotnet10.0, dotnet8.0, dotnet9.0, freeipmi…

More from Wednesday 23 September →