Cloudflare has optimized its DNS zone building services, resulting in a 85% reduction in RAM usage and a significant increase in processing speed. The company now handles 800 zone changes per second, compared to 250 changes four years ago.
Engineers implemented a system to classify change events, allowing for partial builds instead of full ones. For domains with millions of records, updates are now performed piecemeal. These changes reduced RAM consumption on Zone Builder servers from a range of 50–79 GB to approximately 7 GB.
The team also consolidated two separate schedulers into a single unit and modified the processing logic for Apache Kafka messages. Previously, the system waited for slow builds to finish before processing new requests, creating queues.
The updated scheduler now processes smaller incoming jobs while waiting for larger tasks, eliminating long request queues. As a result of these improvements, the median build time decreased from 7.7 seconds to 3.3 seconds.






