You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Envoy's round_robin and least_request support per-endpoint weights. In gRPC, we don't support them, and aren't that interested in supporting them (everyone would pay the cost).
weighted_round_robin (WRR) does have per-endpoint weights, so would be possible there. But WRR would also naturally detect (after a short period of time, and if blackout_period is small enough) that the backend can't handle much load and give it less traffic. As the JIT makes things faster, WRR would naturally give it more traffic. But we could also use this scaling factor when in the blackout_period, which might work nicely.
Without any changes, least_request may improve the situation in gRPC vs round_robin. Worth a try at least.
We're unlikely to get to this soon, so if you're interested, you'd probably want to contribute a gRFC and implementation. We'd be willing to review.
@ejona86 I got the point, so I wanted to also understand how will outlier_detection and ocra weighted load balancing can all come together in this scenario.
So let me elaborate our use case:
We need locality load balancing, so we can have zone affinity and a zone's traffic doesn't breach to another zone
We need outlier_detection, so if a backend is not behaving well we can cut off traffic from it and instead distribute it to other backends
We may in some cases (not all) need hedging support, for example if we are making call to a service which is supposed to yield data from a pass through cache, we may want to call multiple servers of this service and yield data from the first response while initiating other servers to do a refresh of the pass through data.
We need to handle cases where new servers can be slow to start and increase the latency of the requests and failure rates.
Now I wanted to understand how will all these combine. 3 is what I am guessing is not related to the load balancing policy and should work either ways.
1 requires weighted round robin, but then as you suggest using least_request for 4 might defeat the purpose 1.
outlier_detection I believe is a load balancer policy in itself which takes a child policy. I am not sure how will OCRA fit in these. I am not able to very well explain the heirarcy here I believe, but do you have suggestions where all of these requirements can fit in, may be with the current solution or something that needs to be implemented.
Use case is to make the system more resilient to error cases, low cost and fast (we can say best of all worlds :P). I am not able to properly see the internals, but I believe with the set of right configurations GRPC xds can do all of the above, may be adding some cost for making load-balancing decision, but that will anyways be better anyday to instead add a envoy proxy in between to manage these requests.
(2) and (3) are fine. outlier_detection simply marks backends as bad and child LB policies treat those backends as if they can't establish a connection.
(1) is a different WRR... there are multiple. This is the one we don't talk about much. This is WRR for choosing a locality within a priority, which is different than choosing an endpoint within a locality. (xds_wrr_locality/weighted_target; weighted target is what does most of the work here. These weights come from xDS.) If you want 100% of traffic to go one way, that is probably priority which is a bit higher in the tree. Priority has 100% of traffic go to the highest-priority that actually works.
(4): I also made a statement that WRR (endpoint-level weighted_round_robin, which uses ORCA) would behavior similarly to what you want with a short blackout_period. For a short time it'd receive an average amount of traffic by this client, but then the client would realize it can't handle much load (because it is slow) and reduce its weight. But least_request is easier to set up.
Activity
ejona86 commentedon Nov 27, 2023
Envoy's
round_robinandleast_requestsupport per-endpoint weights. In gRPC, we don't support them, and aren't that interested in supporting them (everyone would pay the cost).weighted_round_robin(WRR) does have per-endpoint weights, so would be possible there. But WRR would also naturally detect (after a short period of time, and if blackout_period is small enough) that the backend can't handle much load and give it less traffic. As the JIT makes things faster, WRR would naturally give it more traffic. But we could also use this scaling factor when in the blackout_period, which might work nicely.Without any changes, least_request may improve the situation in gRPC vs round_robin. Worth a try at least.
We're unlikely to get to this soon, so if you're interested, you'd probably want to contribute a gRFC and implementation. We'd be willing to review.
ejona86 commentedon Nov 27, 2023
Note to self: least_request in Envoy has a completely different data structure/algorithm when the weights are varied:
https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/load_balancers.html#weighted-least-request
altaiezior commentedon Nov 29, 2023
@ejona86 I got the point, so I wanted to also understand how will outlier_detection and ocra weighted load balancing can all come together in this scenario.
So let me elaborate our use case:
Now I wanted to understand how will all these combine. 3 is what I am guessing is not related to the load balancing policy and should work either ways.
1 requires weighted round robin, but then as you suggest using least_request for 4 might defeat the purpose 1.
outlier_detection I believe is a load balancer policy in itself which takes a child policy. I am not sure how will OCRA fit in these. I am not able to very well explain the heirarcy here I believe, but do you have suggestions where all of these requirements can fit in, may be with the current solution or something that needs to be implemented.
Use case is to make the system more resilient to error cases, low cost and fast (we can say best of all worlds :P). I am not able to properly see the internals, but I believe with the set of right configurations GRPC xds can do all of the above, may be adding some cost for making load-balancing decision, but that will anyways be better anyday to instead add a envoy proxy in between to manage these requests.
ejona86 commentedon Nov 29, 2023
What control plane are you using?
For reference: https://github.com/grpc/proposal/blob/master/A52_graphics/grpc_xds_client_architecture.svg
(2) and (3) are fine. outlier_detection simply marks backends as bad and child LB policies treat those backends as if they can't establish a connection.
(1) is a different WRR... there are multiple. This is the one we don't talk about much. This is WRR for choosing a locality within a priority, which is different than choosing an endpoint within a locality. (
xds_wrr_locality/weighted_target; weighted target is what does most of the work here. These weights come from xDS.) If you want 100% of traffic to go one way, that is probably priority which is a bit higher in the tree. Priority has 100% of traffic go to the highest-priority that actually works.(4): I also made a statement that WRR (endpoint-level weighted_round_robin, which uses ORCA) would behavior similarly to what you want with a short blackout_period. For a short time it'd receive an average amount of traffic by this client, but then the client would realize it can't handle much load (because it is slow) and reduce its weight. But least_request is easier to set up.
sergiitk commentedon Dec 12, 2023
Seems we've done as much as we can for now. Once you have more info or questions, comment, and this can be reopened.
altaiezior commentedon Dec 13, 2023
Yes thanks for update I will check back this again later