Consistent hashing balances keys, but one server still ends up overloaded in practice. How can the scheme be changed to bound the load?
Sketch your own answer first, then compare it with the one below.
A strong answer
Plain consistent hashing balances the expected number of keys, not the worst case, and not requests. Random variation and skewed popularity can leave one node well above average even with many virtual nodes.
Consistent hashing with bounded loads adds a capacity limit per node, set slightly above the average load. A key is assigned to the first node clockwise whose current load is below the limit. If its natural owner is full, the key spills to the next node with room.
This gives a provable upper bound on the maximum load relative to the average, while keeping the property that membership changes disturb only a small number of assignments. The trade is that placement now depends on current loads, so lookup needs that state or must replay the assignment, and a spilled key lives away from its natural owner.
The technique suits load balancing of long-lived assignments, such as sticky routing of clients to servers or placement of items on servers. State what it does not fix: a single key whose request rate alone exceeds one node's capacity.
Sources
- Vahab Mirrokni, Mikkel Thorup, Morteza Zadimoghaddam (2016). Consistent Hashing with Bounded Loads.