Hardware Infrastructure & Performance Optimization
How Pingora keeps count

How Pingora keeps count

5/12/2023 · Yuchen Wu

What this post added

This post introduces `pingora-limits`, a new library within Cloudflare's in-house proxy, Pingora. It addresses the need for efficient counting of inflight events and estimation of event rates to protect infrastructure. The library utilizes the Count-Min Sketch algorithm, offering significant improvements in space efficiency (O(log n)) and performance (lock-free, O(1) per event) compared to traditional hash table approaches, especially at Cloudflare's scale of millions of requests per second across tens of thousands of machines.

Read the original post ↗