IT

Cloudflare halved DNS build delay and cut memory use by 85%

Cloudflare engineers optimized their DNS propagation pipeline, slashing peak memory usage by 85% and cutting DNS change latency in half.

·2 min read
Cloudflare halved DNS build delay and cut memory use by 85%

Cloudflare has announced major updates to its DNS propagation pipeline, which currently processes about 700 record changes per second—nearly triple the volume from 2022. With some zones holding over 20 million records and scaling toward hundreds of millions, the team needed to overhaul how changes are processed.

  • Cloudflare introduced a targeted build planner that chooses the smallest safe build for each DNS event.
  • Peak memory usage was reduced by 85% by eliminating full zone rebuilds for minor setting changes.
  • The time from a DNS change to its propagation in Quicksilver was cut in half.
  • Large zones with tens of million records no longer overwhelm system memory during updates.

The Evolution of Zone Builder Previously, the original Zone Builder rebuilt the desired state from the current database state without needing to know why a zone changed. While inexpensive for small zones, this approach meant that for the largest zones with tens of millions of records, the data simply did not fit in memory all at once. Furthermore, adding zone settings like Universal SSL made targeting much harder. A full build read, encoded, and compared every single record every time, creating massive computational overhead.

Targeted Planner and Build Types To solve this, the engineering team built a targeted build planner and scheduler. The system now categorizes changes and chooses from five specific build types—updating only resources, metadata, or the zone apex when appropriate, rather than triggering a full zone rebuild. If safety cannot be proven or events are ambiguous, the system defaults back to a full build to ensure edge correctness.

Business and Infrastructure Impact These improvements provide Cloudflare's global network with the headroom needed to support future scaling toward hundreds of millions of records while ensuring lightning-fast DNS updates for users worldwide.

Source: Hacker News: Front Page

Related articles