Skip to content

Make WRR LB thread aware #3278

@htuch

Description

@htuch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions