Cloudflare Trims 100TB of Memory From Its 1.1.1.1 DNS Resolver
Cloudflare's engineering team recently detailed how they slashed memory usage across the fleet running their 1.1.1.1 public DNS resolver, saving roughly 100 terabytes in aggregate. The gains came not from adding hardware or rearchitecting the service, but from rethinking how cached DNS records are stored in memory at massive scale.
By restructuring the cache's internal data layout, reducing per-entry overhead, and cutting out redundant metadata kept for each cached record, the team squeezed significantly more entries into the same memory footprint. Since 1.1.1.1 handles enormous volumes of queries across thousands of machines worldwide, even tiny per-record savings multiply into huge fleet-wide reductions.
The post walks through the profiling process that surfaced the inefficiencies and the specific engineering trade-offs made to fix them without hurting cache hit rates or lookup speed.