TL;DR
Cloudflare's billing pipeline, which processes millions of daily queries on ClickHouse (an analytics database), suddenly slowed after a migration despite normal I/O and memory metrics. Engineers discovered a hidden bottleneck buried in ClickHouse's internal query processing logic rather than obvious resource constraints.
✦ Why It Matters
Engineers should investigate internal subsystem bottlenecks when standard metrics appear normal during performance degradation.
Key Takeaways
Full Summary
Cloudflare relies heavily on ClickHouse, an open-source OLAP (online analytical processing) database designed for fast analytical queries, to process petabyte-scale billing data across dozens of clusters. Their daily aggregation jobs determine customer charges and power fraud detection systems worth hundreds of millions in revenue.
After a migration, these jobs inexplicably slowed despite standard performance diagnostics showing normal I/O, memory usage, rows scanned, and data partition reads. Rather than resource exhaustion, the team identified a hidden bottleneck in ClickHouse's internal query execution engine.
They developed and deployed three targeted patches addressing the root cause within ClickHouse's core processing logic. This discovery demonstrates that performance problems in complex distributed systems can hide behind normal-looking metrics, requiring deep investigation of internal subsystems.
Related