-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Endpoints weight are not respected from the start #31378
Comments
Hmmm, from my personal perspective, this distribution looks like reasonable. Because from you configuration, only 1/11 requests should be routed to canary. |
cc @tonya11en for he is more familiar than me in this area. |
@wbpcode in general distribution is okay, problem with first N requests that always hit higher weight endpoints. With more endpoints there will be more requests hitting higher weight endpoints only. |
This is a known problem with the EDF scheduler we use in the Least Request LB. EDF is essentially a min-heap of hosts, where each host weight is If you'd like to understand what's going on a bit better, take a look at the issue opened to implement an alternative scheduler and the various comments linked in the description. The reason we haven't switched out the EDF scheduler is that it is resilient to host weights changing. Alternative scheduling disciplines avoid this first-pick problem by rebuilding some data structure after each change in host weights, which for the least request LB is after every host selection. The alternative schedulers would be fine for the weighted round-robin LB, though. I think @adisuissa was looking at picking this work up a few weeks ago, but I'm not sure what the status is now. |
@tonya11en thanks for the insights, really helpful. While there is no solution for this particular problem are you aware of any possible workarounds? |
The only workaround I can think of is to avoid using the EDF scheduler. I don't know the specifics of your situation, but the only sane option that comes to mind involves removing the endpoint weights. Use the LEAST_REQUEST load balancer with no endpoint weights set. This would rely on the load balancer scaling the endpoint weight based on the number of outstanding requests. The EDF scheduler isn't used in this case. |
Thanks. I’m closing this one since more specific issue exists |
Title: Endpoints weight are not respected from the start
Description:
When there are multiple endpoints with different weights (100 and 10 in our case), endpoints with lower weight are not being called till some point. I've done some local testing and with these weights at least 50 of first requests are going to endpoints endpoint with higher weight. In our environment sometime it requires much more requests to reach lower weighted endpoints that results those endpoints might get no traffic at all for hours when added for some low traffic services.
Repro steps:
I tested locally with this envoy config:
And was just curling in the loop like this:
It almost always return
50 primary
for first iteration. Example of output:Let me know if you actually need other debug information. I just do not think it is relevant here.
Tested on envoy version 1.24.2 and 1.28.0. Was able to reproduce on both of them.
The text was updated successfully, but these errors were encountered: