Get the latest tech news

The power of two random choices (2012)


In many large-scale web services, multiple layers of stateless and stateful services are seperated by load balancers. Load balancing can be done with dedicated hardware, with dedicated software load balancers, using DNS trickery or through a load-balancing mechanism in the client.

With many typical loads, though, picking a random host degrades latency and reduces throughput by wasting resources on servers which end up unlucky and quiet. Best of 2 is good because it combines the best of both worlds: it uses real information about load to pick a host (unlike random), but rejects herd behavior much more strongly than the other two approaches. Take a look at The Power of Two Random Choices for a much stronger mathematical argument, and some more surprising places this algorithm works really well.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of power

power

Photo of random choices

random choices

Related news:

News photo

A Deep Dive Into The Power & Thermals For The Framework Desktop With AMD Ryzen AI Max

News photo

This 5-in-1 charger is the only one I'll need to travel (and it's full of power)

News photo

On his 75th birthday, Apple legend Steve Wozniak pops up in a comment thread about his 'bad decision' to sell his stock in the '80s with a devastatingly zen reply: 'I gave all my Apple wealth away because wealth and power are not what I live for'