<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/cloudflare-cuts-100-tb-of-memory-from-1-1-1-1-dns-cache-yzw8fsmd5" -->

---
title: Cloudflare Cuts 100 TB of Memory from 1.1.1.1 DNS Cache
description: Cloudflare redesigned the in-memory representation of its Big Pineapple DNS cache used by the 1.1.1.1 resolver, cutting the per-entry footprint by 56% and...
canonical: https://daily.dev/posts/cloudflare-cuts-100-tb-of-memory-from-1-1-1-1-dns-cache-yzw8fsmd5
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Cloudflare Cuts 100 TB of Memory from 1.1.1.1 DNS Cache | daily.dev
og:description: Cloudflare redesigned the in-memory representation of its Big Pineapple DNS cache used by the 1.1.1.1 resolver, cutting the per-entry footprint by 56% and...
og:url: https://daily.dev/posts/cloudflare-cuts-100-tb-of-memory-from-1-1-1-1-dns-cache-yzw8fsmd5
og:image: https://api.daily.dev/og/posts/yzW8FsMd5.png
og:image:alt: Cloudflare Cuts 100 TB of Memory from 1.1.1.1 DNS Cache
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloudflare Cuts 100 TB of Memory from 1.1.1.1 DNS Cache

**[InfoQ](https://daily.dev/sources/infoq)** · 3 min read · 6 upvotes · 2 comments

## Summary

Cloudflare redesigned the in-memory representation of its Big Pineapple DNS cache used by the 1.1.1.1 resolver, cutting the per-entry footprint by 56% and freeing about 100 TB of working-set memory fleetwide. Five successive Rust changes replaced Vec/String with Box<[T]>/Box<str>, merged record lists with compact offsets, packed booleans into bitflags, and ultimately stored record data as a contiguous byte buffer in DNS wire format, avoiding enum boxing overhead that hurt memory locality. Insertion throughput rose 43% and lookup latency fell 19%. Production rollout between May 18 and July 6, 2026 cut p99 resident memory per instance from 9.3 GB to 5.3 GB. Cloudflare plans to use the freed memory to expand cache capacity without increasing consumption.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.infoq.com/news/2026/09/cloudflare-dns-cache>

## Questions this post answers

### How did Cloudflare reduce memory usage in its 1.1.1.1 DNS cache?

Cloudflare redesigned the in-memory representation of its Big Pineapple DNS cache in Rust, replacing Vec and String with Box<[T]> and Box<str>, merging answer/authority/additional records into one list with compact offsets, packing booleans into bitflags, and ultimately storing record data as a contiguous byte buffer in DNS wire format. This cut per-entry footprint from 953 to 420 bytes and freed roughly 100 TB of working-set memory fleetwide.

_daily.dev surfaces engineering deep dives like this for developers optimizing memory-heavy caching systems in Rust._

### Why did Cloudflare avoid boxing large enum variants in its Rust DNS cache?

Boxing larger enum variants created separate heap allocations that added overhead and reduced memory locality, which hurt performance at Cloudflare's scale. Instead, Cloudflare stored record data in a contiguous byte buffer using DNS wire format, removing per-record allocation overhead and improving cache locality, though records containing domain names still need parsing for DNS name compression.

_developers weighing rust enum layout tradeoffs can find similar systems design writeups through daily.dev._

### How much did Cloudflare's DNS cache optimization improve performance and memory usage?

The redesign reduced benchmarked per-entry memory footprint by 56%, from 953 to 420 bytes, and cut allocations from 1.1 KB to 461 bytes. Insertion throughput increased 43% and lookup latency dropped 19%. In production, p99 resident memory per instance fell from 9.3 GB to 5.3 GB, freeing about 100 TB of working-set memory across the fleet between May 18 and July 6, 2026.

_daily.dev helps engineers track real-world benchmarks like this when justifying cache architecture changes._

## Community discussion

Top comments from developers on daily.dev.

**@trevorsuna** · 0 upvotes

> The most interesting part is that the memory win also improved lookup latency and insertion throughput. Compact wire-format storage reduced allocation and pointer-chasing costs together; it’s a good reminder to profile representation and locality before reaching for a more complex cache eviction strategy.

**@nahum** · 0 upvotes

> the first win is just Vec to Box<[T]>, 24 bytes to 16 by dropping the capacity field. boring change, times billions of entries.
>
> wire format storage is the clever one, serving becomes almost a memcpy. and lookups got 19% faster, usually memory savings cost you latency

## Similar posts on daily.dev

- [Saving another 100TB of RAM with math \(and Rust\)](https://daily.dev/posts/saving-another-100tb-of-ram-with-math-and-rust--vnv8imyss) · Cloudflare · 110 upvotes · 18 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#rust](https://daily.dev/tags/rust), [#cloudflare](https://daily.dev/tags/cloudflare), [#dns](https://daily.dev/tags/dns)

[View this post on daily.dev](https://daily.dev/posts/cloudflare-cuts-100-tb-of-memory-from-1-1-1-1-dns-cache-yzw8fsmd5)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Cloudflare Cuts 100 TB of Memory from 1.1.1.1 DNS Cache","url":"https://daily.dev/posts/cloudflare-cuts-100-tb-of-memory-from-1-1-1-1-dns-cache-yzw8fsmd5","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/cloudflare-cuts-100-tb-of-memory-from-1-1-1-1-dns-cache-yzw8fsmd5"},"datePublished":"2026-09-23T13:33:15.890Z","dateModified":"2026-09-23T13:33:40.332Z","description":"Cloudflare redesigned the in-memory representation of its Big Pineapple DNS cache used by the 1.1.1.1 resolver, cutting the per-entry footprint by 56% and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/827368f790885378217ae51a7e3e8ae2?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/827368f790885378217ae51a7e3e8ae2?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"InfoQ","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"InfoQ","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/afc3bced3e1e4b188dd9127017a60e0c","url":"https://daily.dev/sources/infoq"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/cloudflare-cuts-100-tb-of-memory-from-1-1-1-1-dns-cache-yzw8fsmd5","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":6},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"performance,rust,cloudflare,dns","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"InfoQ","item":"https://daily.dev/sources/infoq"},{"@type":"ListItem","position":3,"name":"Cloudflare Cuts 100 TB of Memory from 1.1.1.1 DNS Cache"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/cloudflare-cuts-100-tb-of-memory-from-1-1-1-1-dns-cache-yzw8fsmd5","comment":[{"@type":"Comment","text":"The most interesting part is that the memory win also improved lookup latency and insertion throughput. Compact wire-format storage reduced allocation and pointer-chasing costs together; it’s a good reminder to profile representation and locality before reaching for a more complex cache eviction strategy.","datePublished":"2026-09-28T01:51:08.683Z","url":"https://daily.dev/posts/yzW8FsMd5#c-MCan3zSVA","author":{"@type":"Person","name":"Trevor Suna","url":"https://daily.dev/trevorsuna","image":"https://media.daily.dev/image/upload/s--dZ7gXxpp--/f_auto/v1784081551/avatars/avatar_EMoP47rpuw8DNjhp6R1b6?_a=BAMAMicg0"}},{"@type":"Comment","text":"the first win is just Vec to Box&lt;[T]&gt;, 24 bytes to 16 by dropping the capacity field. boring change, times billions of entries.\nwire format storage is the clever one, serving becomes almost a memcpy. and lookups got 19% faster, usually memory savings cost you latency","datePublished":"2026-10-01T17:32:49.477Z","url":"https://daily.dev/posts/yzW8FsMd5#c-JfRvenDfd","author":{"@type":"Person","name":"Nahum Litvin","url":"https://daily.dev/nahum","image":"https://lh3.googleusercontent.com/a-/AOh14GhvJ2y-9R45d5ee78ZdAo8l7J3t4G8fINkx5PEqBfA=s100"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/cloudflare-cuts-100-tb-of-memory-from-1-1-1-1-dns-cache-yzw8fsmd5#faq","mainEntity":[{"@type":"Question","name":"How did Cloudflare reduce memory usage in its 1.1.1.1 DNS cache?","acceptedAnswer":{"@type":"Answer","text":"Cloudflare redesigned the in-memory representation of its Big Pineapple DNS cache in Rust, replacing Vec and String with Box<[T]> and Box<str>, merging answer/authority/additional records into one list with compact offsets, packing booleans into bitflags, and ultimately storing record data as a contiguous byte buffer in DNS wire format. This cut per-entry footprint from 953 to 420 bytes and freed roughly 100 TB of working-set memory fleetwide. daily.dev surfaces engineering deep dives like this for developers optimizing memory-heavy caching systems in Rust."}},{"@type":"Question","name":"Why did Cloudflare avoid boxing large enum variants in its Rust DNS cache?","acceptedAnswer":{"@type":"Answer","text":"Boxing larger enum variants created separate heap allocations that added overhead and reduced memory locality, which hurt performance at Cloudflare's scale. Instead, Cloudflare stored record data in a contiguous byte buffer using DNS wire format, removing per-record allocation overhead and improving cache locality, though records containing domain names still need parsing for DNS name compression. developers weighing rust enum layout tradeoffs can find similar systems design writeups through daily.dev."}},{"@type":"Question","name":"How much did Cloudflare's DNS cache optimization improve performance and memory usage?","acceptedAnswer":{"@type":"Answer","text":"The redesign reduced benchmarked per-entry memory footprint by 56%, from 953 to 420 bytes, and cut allocations from 1.1 KB to 461 bytes. Insertion throughput increased 43% and lookup latency dropped 19%. In production, p99 resident memory per instance fell from 9.3 GB to 5.3 GB, freeing about 100 TB of working-set memory across the fleet between May 18 and July 6, 2026. daily.dev helps engineers track real-world benchmarks like this when justifying cache architecture changes."}}]}
```

