Skip to content
Computing

Cloudflare Frees 100TB of RAM by Shrinking 1.1.1.1 DNS Cache

Cloudflare has freed roughly 100TB of RAM across its global server fleet without touching a single physical memory module. The company achieved this by redesigning how each DNS cache entry is stored in memory on Big Pineapple, the platform that powers its popular 1.1.1.1 resolver. In a technical...

Cloudflare Frees 100TB of RAM by Shrinking 1.1.1.1 DNS Cache
Cloudflare has freed roughly 100TB of RAM across its global server fleet without touching a single physical memory module. The company achieved this by redesigning how each DNS cache entry is stored in memory on Big Pine

Cloudflare has freed roughly 100TB of RAM across its global server fleet without touching a single physical memory module. The company achieved this by redesigning how each DNS cache entry is stored in memory on Big Pineapple, the platform that powers its popular 1.1.1.1 resolver.

In a technical blog post, systems engineer Sebastiaan Neuteboom detailed five Rust-level changes that reduced each cached entry from 953 bytes to 420 bytes while making the cache faster overall. The reclaimed memory equals the combined DDR5 found in 130 of Cloudflare’s 768GB Gen 13 servers, savings that carry extra weight given that server-grade DDR5 prices are on track to double year over year.

Why a Single Byte Matters at Scale

The scale of the 1.1.1.1 resolver makes even tiny inefficiencies expensive. Because Big Pineapple holds more than 250 billion cached DNS entries at any given time, a single wasted byte per entry costs Cloudflare over 250GB of fleet memory.

The first of the five changes replaced Rust’s growable Vec and String containers with fixed-size boxed slices, saving more than 15TB on its own by dropping capacity fields the data no longer needs once cached. Additional changes collapsed the three record lists in every DNS response into a single buffer indexed by 2-byte offsets, and removed owner names that duplicate the queried domain, rebuilding them at read time instead.

The final change stores record data as length-prefixed raw wire-format bytes. This ended an arrangement in which a 4-byte A record occupied the same 144 bytes as the largest record type Cloudflare caches, the rarely seen NAPTR. Packing record data contiguously also improved CPU cache locality, so most record types now copy straight from the stored buffer into outgoing responses rather than being re-serialized field by field.

Faster Performance and Lower Memory Footprint

The redesign improved performance alongside efficiency. According to Cloudflare’s benchmarks, insert throughput climbed to 893,000 entries per second, up from 625,000, while lookup latency dropped from 828 to 670 nanoseconds. Over the rollout, which ran from mid-May to early July, p99 resident memory per instance fell from 9.3GB to 5.3GB.

Cloudflare’s Gen 13 servers, which the company calls its most powerful yet, each carry 768GB of DDR5-6400. Cloudflare settled on that configuration in March after pricing out a 1,152GB option and rejecting it in part because of high memory prices.

What Cloudflare Plans to Do With the Savings

This DNS cache project is the second major memory-reclamation effort Cloudflare has completed in the past year, following the FL2 rewrite of its request-handling layer in Rust last September. Efficiency has shaped the company’s hardware decisions for years, including the switch to AMD’s 96-core EPYC 9684X for its Gen 12 servers.

None of the recovered RAM will be converted into smaller memory configurations. Instead, Cloudfl

Source
Image: tomshardware.com

The US tech briefing

Smartphones, AI, computing and deals — the essential stories without the noise.

Mailing provider can be connected when your US list is ready.

Shop Amazon Tech Deals Shop Amazon Tech Deals