Cloudflare Frees 100 TB of Memory by Optimizing DNS Cache

Cloudflare says it has freed roughly 100 terabytes of memory across its infrastructure after making a series of changes to the DNS cache behind its 1.1.1.1 public resolver and other DNS services.

The work focused on Big Pineapple, Cloudflare’s DNS platform, which keeps more than 250 billion cached DNS entries in memory at any given time. At that scale, even a single unnecessary byte per entry can add up to hundreds of gigabytes of additional memory use across the network.

Cloudflare made five changes to how cached DNS data is stored, cutting the average memory footprint of each entry in its benchmarks from 953 bytes to 420 bytes, a reduction of 56 percent.

The changes included replacing memory-heavy data structures with more compact alternatives, combining separate DNS record lists, removing repeated domain-name information and storing record data in a format closer to how DNS responses are transmitted.

The optimizations also improved performance. Cloudflare says cache insertion throughput increased by 43 percent, from 625,000 to 893,000 entries per second, while lookup latency fell by 19 percent from 828 nanoseconds to 670 nanoseconds.

Cloudflare rolled out the changes across its DNS services between May and July 2026. In production, memory use fell significantly, with p99 memory consumption per instance dropping from 9.3 GB to 5.3 GB and p90 usage falling from 6.5 GB to 3.8 GB.

Across the full fleet, the company estimates the changes freed about 100 TB of working memory. Cloudflare compares that to the RAM in roughly 130 of its Gen 13 servers. For a more familiar comparison, 100 TB is also more memory than would be found across 6,000 typical laptops equipped with 16 GB of RAM.

Cloudflare plans to use some of the reclaimed capacity to increase the size of its DNS caches without increasing overall memory consumption. Larger caches can improve hit rates and reduce the number of requests that need to be sent to upstream DNS servers.