News for hackers. Stuff that matters.
Re:The power of two random choices by anschwa on Sunday October 25, 2020 @11:29PM (#24892590)
I did my undergrad CS thesis on this topic and implemented a "power of two choices" load balancing module in NGINX.

When simulating load distribution across servers, two-choices does an outstanding job at keeping things evenly distributed. However, I was unable to observe a meaningful difference between load balancing algorithms when measuring request latency from servers under load.

I think there is still a lot to be gained from exploring two-choices, but coming up with an appropriate strategy for "real-world" performance benchmarking is quite challenging.

Re:The power of two random choices by mjb on Monday October 26, 2020 @09:34AM (#24895973)
> I did my undergrad CS thesis on this topic and implemented a "power of two choices" load balancing module in NGINX.

Cool!

> When simulating load distribution across servers, two-choices does an outstanding job at keeping things evenly distributed. However, I was unable to observe a meaningful difference between load balancing algorithms when measuring request latency from servers under load.

That's very interesting. Were you serving static content? Or running code, too?

Intuitively, I'd expect that NGINX serving static content would tend to scale fairly linearly up to the saturation point, and then get rapidly bad. That's a pretty pessmisic case for load balancer performance measurement, because you won't see effects until you're running the whole system very hot. That 'very hot' modality is important to real-world applications, but certainly makes benchmarking challenging. Does that sound right to you?

In my experience, that tends to change when running complex business logic code, or generating dynamic content. There, the load-latency graph has a higher linear slope. The effects of good load balancing are more immediately visible. It's also more visible in things which explicitly have longer latency with higher load, like some kinds of queue-based and stream-based systems.

Re:The power of two random choices by anschwa on Friday October 30, 2020 @12:08AM (#24939059)
> Intuitively, I'd expect that NGINX serving static content would tend to scale fairly linearly up to the saturation point, and then get rapidly bad

That was essentially what I saw. I was serving very minimal dynamic content that had some random sleeps. I even reached out to the NGINX mailing list and got a similar response about how they wouldn't expect much measurable difference. However, I still think it would be possible to construct a better test.

Re:The power of two random choices by mjb on Monday October 26, 2020 @09:38AM (#24896011)
Hey, this is my blog post! Great to see it here. Best-of-two is one of my favorite things. If you enjoy the simplicity of it, check out the related paper "How asymmetry helps load balancing" by Berthold Vöcking (https://dl.acm.org/doi/10.1145/792538.792546).

Back in 2018 I wrote a follow-up to this, with a little more about the general balls-into-bins problem: http://brooker.co.za/blog/2018/01/01/balls-into-bins.html

Re:The power of two random choices by guyu96 on Monday October 26, 2020 @12:32AM (#24892844)
Link to the paper mentioned in the blogpost: http://www.eecs.harvard.edu/~michaelm/postscripts/handbook20...
Re:The power of two random choices by stevefan1999 on Monday October 26, 2020 @07:51AM (#24895107)
i read it as (the (power of 2) (random choices))...for some reason