Saving another 100TB of RAM with math (and Rust)
Sep 18, 2026Kevin Guthrie, Mariia Iurchenko, Zaidoon Abd Al Hadi, Ivan Babrou

Summary
This post details the optimization of consistent hashing in the Pingora Backend Router (PBR) service, specifically addressing excessive memory usage in the pingora-ketama library. The core problem identified was the memory footprint associated with representing servers with multiple hashes. The solution involved refining the consistent hashing algorithm by: 1. Increasing the number of hashes per server (from 1 to 160) to improve workload distribution and reduce the coefficient of variation. 2. Implementing server weights proportional to disk space (using ketama algorithm principles) to scale workload allocation based on resource availability. This optimization resulted in reclaiming over 100TB of RAM globally.
More from the Rate Limiting and Event Counting trail
- Follow the thread: a new dashboard to investigate account abuse
- The Internet has a second audience
- Have it both ways: stay discoverable in search while disallowing AI training
- Introducing Adaptive Intelligence: undermining the economics of every bot attack
- BotBase for Operators: A clearer path to joining Cloudflare's directory of bots and agents