TLDR Tech / Data
Our billing pipeline was suddenly slow. The culprit was a hidden bottleneck in ClickHouse
Cloudflare's shift to per-tenant retention in a massive ClickHouse “Ready-Analytics” table exposed an unexpected scaling limit: query planning, not I/O or scan volume, became the bottleneck as parts per replica grew. Tracing showed 45% of leaf query CPU time in part filtering. Switching to a shared lock and then a shared-read cache removed most of the contention and cut query latency sharply.
Read the full story