Explain the power of two choices. Why does asking just two servers help so much?
Sketch your own answer first, then compare it with the one below.
A strong answer
Choose two servers uniformly at random, compare their current load, and send the request to the lighter one.
The intuition comes from balls and bins. With one random choice, the heaviest bin ends up noticeably above average because of random clumping. With two choices, any bin that is already heavy tends to lose the comparison, so the heaviest bin grows much more slowly. The improvement from one choice to two is large. Further choices add comparatively little.
The practical value is cost. It needs two probes per decision rather than a scan of all servers, so it scales to large pools and works with many independent balancers, each picking its own random pair.
Its limits are real. It relies on a reasonably current load signal, it cannot help when total load exceeds capacity, and when requests differ in cost the signal should reflect work rather than raw connection count.
Sources
- Michael Mitzenmacher (2001). The Power of Two Choices in Randomized Load Balancing.
- Yossi Azar, Andrei Z. Broder, Anna R. Karlin, Eli Upfal (1999). Balanced Allocations.