Balanced allocation: patience is not a virtue

John Augustine, William K. Moses, Amanda Redlich, Eli UpfalarXiv 2016 · DOI

Abstract

Load balancing is a well-studied problem, with balls-in-bins being the primary framework. The greedy algorithm $Greedy[d]$ of Azar et al. places each ball by probing $d > 1$ random bins and placing the ball in the least loaded of them. It ensures a maximum load that is exponentially better than the strategy of placing each ball uniformly at random. Vocking showed that a slightly asymmetric variant, $Left[d]$, provides a further significant improvement. However, this improvement comes at an additional computational cost of imposing structure on the bins. Here, we present a fully decentralized and easy-to-implement algorithm called $FirstDiff[d]$ that combines the simplicity of $Greedy[d]$ and the improved balance of $Left[d]$. The key idea in $FirstDiff[d]$ is to probe until a different bin size from the first observation is located, then place the ball. Although the number of probes could be quite large for some of the balls, we show that $FirstDiff[d]$ requires only $d$ probes on average per ball. We additionally give experimental data that $FirstDiff[d]$ is indeed as good as $Left[d]$, if not better, in practice.

Introduction

In the world of distributed systems, load balancing is the bread and butter of efficiency. Whether it's routing web requests to servers or mapping data to hash tables, we want to avoid "hotspots" where one resource is overwhelmed while others sit idle. The standard framework for studying load balancing is the "balls-in-bins" model: we want to place $m$ balls into $n$ bins such that the maximum load (the number of balls in the fullest bin) is minimized.

Two classic strategies dominate the literature:

  1. Greedy[$d$]: Pick $d$ bins at random and place the ball in the least loaded one. This is simple and decentralized but leaves room for improvement in balance.
  2. Left[$d$]: Divide bins into $d$ groups and always pick one bin from each group in a specific order. This yields a significantly lower maximum load than $Greedy$, but it requires "structure"—bins must be pre-sorted and managed in groups, which is a headache in decentralized or dynamic systems.

The challenge was to find an algorithm that provides the "asymmetric" performance boost of $Left[d]$ without the structural overhead.

The FirstDiff[$d$] Algorithm

The authors propose FirstDiff[$d$], a load-balancing algorithm that probes bins until it finds two with different loads, then picks the lighter one. The algorithm is elegantly simple and requires no global knowledge or bin groupings.

Extracted table from page 5 of Balanced allocation: patience is not a virtue

The "magic" here is real-time feedback. If the bins are very evenly loaded, the algorithm might probe many times to find a difference. If the loads are varied, it finds a difference quickly. Crucially, the authors prove that even though some balls might require many probes, the average number of probes remains at most $d$ in both standard ($m=n$) and heavily-loaded ($m \gg n$) scenarios.

Key Insights and Ideas

  • Patience is a Waste: The title's punchline is that you don't need to probe a fixed number of bins. Probing more bins that all have the same load tells you nothing new. You only gain useful information for balancing when you find a difference in load.
  • Dynamic Effort: $FirstDiff[d]$ naturally spends more "probing effort" exactly when the system is most balanced (and thus harder to balance further) and less effort when the system is unbalanced.
  • Majorization Proofs: To prove the maximum load bounds, the authors show that $FirstDiff[d]$ "majorizes" $Greedy[2]$. This means that, mathematically, the load distribution under $FirstDiff$ is guaranteed to be at least as balanced as a 2-choice greedy strategy, which they then tighten to match the performance of $Left[d]$.
  • Decentralization: Unlike $Left[d]$, $FirstDiff$ requires no global knowledge, no bin groupings, and no specific ordering. Every ball-placement decision is independent and based solely on the loads of the bins it happens to probe.

Key Results

  • Maximum Load: For $n$ balls in $n$ bins, the maximum load is approximately $\frac{\log \log n}{d \log \phi_d} + O(1)$. This matches the performance of the more complex $Left[d]$ algorithm.
  • Experimental Superiority: In practice, $FirstDiff[d]$ often results in a maximum load that is as good as, or even slightly better than, $Left[d]$. For example, with $n=2^{24}$ and $d=2$, $FirstDiff$ placed 100% of balls such that the max load was 3, whereas $Greedy$ had a significant portion at load 4.

Limitations and Future Work

While the average number of probes is low, the authors acknowledge that the number of probes for a specific ball could be large (up to $2^{\Theta(d)}$). In systems with strict latency requirements for every single operation, this variance might be a concern. Future work could explore how $FirstDiff$ performs in heterogeneous systems where bins have different capacities or balls have different weights, or adapt it to account for network topology where probing costs vary.

Summary updated

Abstract

Load balancing is a well-studied problem, with balls-in-bins being the primary framework. The greedy algorithm Greedy[d] of Azar et al. places each ball by probing d > 1 random bins and placing the ball in the least loaded of them. It ensures a maximum load that is exponentially better than the strategy of placing each ball uniformly at random. Vocking showed that a slightly asymmetric variant, Left[d], provides a further significant improvement. However, this improvement comes at an additional computational cost of imposing structure on the bins.Here, we present a fully decentralized and easy-to-implement algorithm called FirstDiff[d] that combines the simplicity of Greedy[d] and the improved balance of Left[d]. The key idea in FirstDiff[d] is to probe until a different bin size from the first observation is located, then place the ball. Although the number of probes could be quite large for some of the balls, we show that FirstDiff[d] requires only d probes on average per ball (in both the standard and the heavily-loaded settings). Thus the number of probes is no greater than either that of Greedy[d] or Left[d]. More importantly, we show that FirstDiff[d] closely matches the improved maximum load ensured by Left[d] in both the standard and heavily-loaded settings. We additionally give experimental data that FirstDiff[d] is indeed as good as Left[d], if not better, in practice.
BibTeX
@misc{augustine2016balanced,
  author = {John Augustine and William K. Moses and Amanda Redlich and Eli Upfal},
  title = {{Balanced allocation: patience is not a virtue}},
  year = {2016},
  eprint = {1602.08298},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1602.08298},
}
Figure