Cloudflare's Pingora router defaulted to ketama's standard 160 hash points per server (NGINX's default too); the math showed that count could be cut 90% with no meaningful added error, since 32-bit hash collisions become the limiting factor at high hash counts.
A Rust struct-alignmentThe work of making AI systems actually pursue what their builders and users intend, rather than something subtly or dangerously different.Full definition → fix (storing each hash/index pair as a packed raw byte array with getters instead of a naturally-aligned struct) cut consistent-hashing memory by 25% on its own, with no change to the hashing algorithm itself.
The two changes together reclaimed over 100TB of RAM globally, on top of the 100TB Cloudflare's DNS team had already freed the month before.
Rather than a global flip, Cloudflare ran the old and new hash rings in memory simultaneously, chosen per request, and rolled out data center by data center, trading temporary extra memory for a clean rollback path and a small blast radius.
Ketama's disk-space-weighted hashing can't be extended to per-request eligibility rules like compliance or feature flags by adding more points to one ring; every combination of constraints needs its own separate hash ring.
Terms in this piece · Glossary
alignment — The work of making AI systems actually pursue what their builders and users intend, rather than something subtly or dangerously different.
Why it matters
A concrete algorithmic case study in squeezing memory waste out of infrastructure at scale, with lessons applicable to anyone running consistent-hashing based routing or load balancing.