Christoph Lenzen, STOC 2011 What is Load Balancing? optimizing storage utilization work sharing hashing low-congestion routing Christoph Lenzen, STOC 2011 An Example of Parallel Load Balancing • • • • fully connected network small & equal bandwidths (one message/round) n nodes need to send/receive up to n messages minimize number of rounds Christoph Lenzen, STOC 2011 An Example of Parallel Load Balancing • • • • fully connected network small & equal bandwidths (one message/round) n nodes need to send/receive up to n messages minimize number of rounds Christoph Lenzen, STOC 2011 An Example of Parallel Load Balancing ? ? but... ? • • • • fully connected network small & equal bandwidths (one message/round) n nodes need to send/receive up to n messages minimize number of rounds Christoph Lenzen, STOC 2011 Abstraction: Parallel Balls-into-Bins • distribute n balls into n bins = = • replace knowledge by randomization! • n instances (one for each receiver) Christoph Lenzen, STOC 2011 Naive Approach: Fire-and-Forget • throw balls uniformly independently at random (u.i.r.) • max. load (ln n / ln ln n) with high probability (w.h.p.) Christoph Lenzen, STOC 2011 The Power of Two Choices (e.g. Azar et al., SIAM J. of Comp.‘99) • • • • • • inspect two bins and decide take least loaded max. load (ln ln n) w.h.p. d choices: (ln ln n / ln d ) w.h.p. (ln ln n / d ) possible Vöcking, JACM‘92 ...but not parallel! Christoph Lenzen, STOC 2011 The Parallel Power of Two Choices • strongest upper bound: Stemann, SPAA‘96 max. load ln n / ln ln n • tight for constant r 1/ r in r rounds Adler et al., STOC‘95 • ...and certain algorithms: – non-adaptive (fix bins to contact in advance) – symmetric (all choices uniform) Christoph Lenzen, STOC 2011 An Adaptive Algorithm • • ≈ • < • contact one bin every bin accepts one ball n/e balls remain (w.h.p.) contact 2<e bins n/e2 balls remain (w.h.p.) contact k<e2 bins, and so on Christoph Lenzen, STOC 2011 The Power of the Tower • • • • • • termination in log*n O(1) rounds log*(2x ) log*( x) 1 cap # contacted bins at log n log* x x O(n) total messages w.h.p. 0 1 O(1) in exp. (for each ball and bin) 1 2 can enforce max. load 2 2 4 tolerates message loss & faulty bins 3 16 4 65,536 5 ≈1020,000 Christoph Lenzen, STOC 2011 Optimality? • for symmetric algorithms: – – – – many balls in symmetric trees for (1 o(1)) log*(n) rounds balls cannot contact many bins w/o incurring (n) messages if balls in such a tree terminate root gets expected load (1) many such trees => max. load (1) w.h.p. root Christoph Lenzen, STOC 2011 No Faster Solution Possible, unless... • bin loads of (1) are accepted, place (1 o(1))ns balls at once • bins have "identities" known to all balls • (n) messages are used Christoph Lenzen, STOC 2011 Exploiting Asymmetry/Bin ID‘s • • • • • • subsets of (1) bins contact random “leader” bin “leader” bins distribute balls in their subset can place (1 o(1))n balls right away continue with previous algorithm max. load 3 in O(1) rounds ? ? ? #1 #2 #3 Christoph Lenzen, STOC 2011 How to Use (n) Messages • • • • • balls “coordinate” constant fraction of bins each ball contacts (1) bins (1 o(1))n balls find coordinated bins coordinators assign O(1) balls to “their” bins proceed with symmetric algorithm X XX X (1) (1) Christoph Lenzen, STOC 2011 Summary • optimal symmetric solution – max. load 2, O(n) mess., log*n O(1) rounds • constant-time if: – global enumeration of bins – (n) messages – (1) max. load Christoph Lenzen, STOC 2011 ...hey, What Happened to the Original Problem?! • can be solved in O(1) rounds • can be used to sort n 2 keys in O(1) rounds Patt-Shamir and Teplitsky, PODC‘11 Christoph Lenzen, STOC 2011 Christoph Lenzen, STOC 2011