We halved DNS build delay and cut memory use by 85% blog.cloudflare.com · 26 poi...

@best

We halved DNS build delay and cut memory use by 85% blog.cloudflare.com · 26 points · 7 comments · HN thread

TL;DR Cloudflare describes how it reworked the Zone Builder, the stage of its DNS pipeline that turns zone changes into data for its authoritative servers, so that most changes trigger a small targeted build instead of rebuilding the whole zone. A new planner picks the smallest build it can prove safe, and a unified scheduler merges work per zone. The company reports 85% lower peak memory and median build completion delay halved from about 7.7 to 3.3 seconds.

  • Zone Builder now handles about 700 DNS record changes per second, up from 250 in 2022, plus about 100 other events; some zones exceed 20 million records.
  • A targeted build planner chooses among resources-only, resources-and-metadata, apex-and-metadata, purge, and full-zone builds, and falls back to full builds on any uncertainty.
  • Above a record-count threshold the Zone Builder no longer escalates to full builds, accepting the tradeoff that a full build of those zones could not finish.
  • Over 24 hours, 92.95% of builds avoided rebuilding the full zone; full builds fell by about 40%, and peak working-set memory dropped from 79 GiB to 12 GiB.
  • Validation used byte-for-byte equivalence tests, a full build run alongside targeted builds, and a mirror environment comparing a 20% zone sample, with a hash-based staged rollout.
  • Shorter per-zone rebuild intervals and a smaller DNS Kafka Aggregator buffer, enabled by cheaper builds, account for part of the halved delay; p99 tail spike fell from 14.6 to 1.21 minutes.

Discussion The comment thread is small and mostly curious rather than critical. One commenter links the efficiency work to rising memory prices and asks about the return on optimization, which leads to a side discussion about bloated desktop apps. The main thread questions whether 700 changes per second is plausible for a provider of Cloudflare's size, and two replies work through rough domain-count arithmetic to argue that the number is consistent with a long-tailed distribution of DNS edits.

  • Skeptical that 700 changes per second is realistic at this scale (some): One commenter argues the rate looks low given Cloudflare's domain count. A reply notes that 412 million registered domains would imply about 15% changing daily, which seems unlikely.
  • Long-tail distribution makes the rate plausible (some): Another commenter estimates Cloudflare manages roughly 180 million domains and says most sites rarely change DNS, so 700 changes per second is about 1.8 billion per month, which is plausible.
  • Memory pressure may push more software optimization (a few): One commenter wonders whether rising memory prices will make efficiency work more valuable, and suggests weighing both current and near-future returns.
  • Electron-style apps waste memory (a few): A commenter describes a Mac with 64 GB of RAM running out of memory due to poorly optimized applications, and blames web-based frameworks such as Electron.

#DNS #Cloudflare #distributedSystems #memoryOptimization #Kafka