Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The Power of Two Choices" Load-Balancing Algorithm #75

Closed
analogrelay opened this issue Apr 20, 2020 · 0 comments · Fixed by #78
Closed

"The Power of Two Choices" Load-Balancing Algorithm #75

analogrelay opened this issue Apr 20, 2020 · 0 comments · Fixed by #78
Labels
Type: Idea This issue is a high-level idea for discussion.

Comments

@analogrelay
Copy link
Contributor

This falls somewhere between Random (#73) and Least-Requests (#74). It tends to be easier to implement across a cluster of proxies.

Given that load-balancers don't share state about the load to each backend (this would be very costly), a proxy instance is making it's decision based on the number of outstanding requests it has to the backends, and not the number of requests all instances have. This means that often multiple proxy instances can see the same nodes as under-utilized and send a storm of requests to it (if the incoming traffic is randomly balanced, as tends to be the case).

The "Power of Two Choices" model (discussed in some sources below) adds a degree of randomness by first selecting two random backends and then making a "least-outstanding-requests" decision between those two. This helps to prevent these storms of traffic. This doesn't generally perform better than Least Requests/Connections in a single-node proxy deployment, but it can be better than Random in situations where each node doesn't have perfect knowledge of the load

Sources

@analogrelay analogrelay added the Type: Idea This issue is a high-level idea for discussion. label Apr 20, 2020
@analogrelay analogrelay added this to the 1.0.0 milestone Apr 20, 2020
@Tratcher Tratcher modified the milestones: 1.0.0, 1.0.0-preview1 Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Idea This issue is a high-level idea for discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants