-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Make WRR LB thread aware #3278
Comments
Somewhat related to #2874. |
@alyssawilk points out that this might not do brilliantly as the number of hosts scales if we want the full range of weights preserved, and that what we do today with the consistent hash schemes is also problematic. We should explore these tradeoffs more thoroughly before committing to a specific implementation path here. |
FWIW, gRPC-LB (https://grpc.io/blog/loadbalancing) effectively works with a fully precomputed static schedule for WRR. |
The existing WRR LB uses a per-thread EDF scheduler. This makes memory usage O(m * n) where m is the number of hosts and n the number of endpoints. We can shrink this to O(n * w), where w is the weight range, if we precompute the schedule on the main thread (as we do for consistent hash balancers) and just maintain an index that we rotate around the shared schedule for WRR. This comes at the downside of increased memory use when we have a wide range of weights, but as long as we maintain a limited set of weights (which we need to do anyway to sanely support locality weighting with the consistent hash balancers), this should be reasonable.
The text was updated successfully, but these errors were encountered: