least request lb: include pending requests#45168
Open
benjawo wants to merge 1 commit into
Open
Conversation
LeastRequestLoadBalancer ranks hosts by host.stats().rq_active_, which only counts streams attached in attachStreamToClient. Streams queued in pending_streams_ on a connection pool waiting for connection establishment are invisible, so a host with slow handshakes can keep winning picks until queued streams attach. See envoyproxy#44989. Add a per-host rq_pending_active gauge tracked in PendingStream's ctor/dtor and have LeastRequestLoadBalancer fold it into the value it compares behind a runtime guard, default off (envoy.reloadable_features.least_request_lb_count_pending_requests). Fixes envoyproxy#44989 Signed-off-by: Ben Wood <wood.ben94@gmail.com>
|
Hi @benjawo, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message:
LeastRequestLoadBalancer ranks hosts by host.stats().rq_active_, which only counts streams attached in attachStreamToClient. Streams queued in pending_streams_ on a connection pool waiting for connection establishment are invisible, so a host with slow handshakes can keep winning picks until queued streams attach. See #44989.
Add a per-host rq_pending_active gauge tracked in PendingStream's ctor/dtor and have LeastRequestLoadBalancer fold it into the value it compares behind a runtime guard, default off
(envoy.reloadable_features.least_request_lb_count_pending_requests).
Fixes #44989
Additional Description: This was an AI assisted code change. I understand all code written.
Risk Level: Low
Testing: UTs. Local repro script against envoy process.
Docs Changes: N/A
Release Notes: New changelog file.
Platform Specific Features: N/A
[Optional Runtime guard:]
envoy.reloadable_features.least_request_lb_count_pending_requests[Optional Fixes #Issue] #44989
[Optional Fixes commit #PR or SHA] N/A
[Optional Deprecated:] N/A
[Optional API Considerations:] N/A