[Forward plugin] Improve load balancing in connection pool#6804
Open
Arkelenia wants to merge 1 commit into
Open
[Forward plugin] Improve load balancing in connection pool#6804Arkelenia wants to merge 1 commit into
Arkelenia wants to merge 1 commit into
Conversation
Arkelenia
commented
Jul 31, 2024
Contributor
Author
There was a problem hiding this comment.
This becomes O(n) instead of the previous O(1) fetching of a connection. On normal operations, I would expect most connections to be valid and only needing to iterate through a few connections before finding a valid one. Benchmarks indicate that each step of the loop is about 5ns.
Signed-off-by: Frederic Hemery <frederic.hemery@datadoghq.com>
14da650 to
5a3dfa9
Compare
thevilledev
requested changes
Mar 27, 2026
thevilledev
left a comment
Collaborator
There was a problem hiding this comment.
Stale PR and conflicts with the changes introduced in #7970. The conn manager no longer exists and the proxy implementation now uses a connection pool.
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.
1. Why is this pull request needed and what does it do?
More details are available in the issue. In a nutshell, when multiple servers back a single destination endpoint (through a Kubernetes clusterIP, for example) in the forward plugin, the traffic is very unbalanced. The connection pool favors slow servers when returning cached connections.
This PR proposes the following changes:
idle_timeoutandmax_connection_age.expireis deprecated in favor ofidle_timeout, hence,idle_timeouttakes precedence if both are defined butexpirecan still be used. For backward compatibility,max_connection_agedefaults to infinite if not defined.This PR is only meant as a suggestion to gather feedback.
2. Which issues (if any) are related?
This PR is a suggestion for this issue.
3. Which documentation changes (if any) need to be made?
Document the new parameters
idle_timeoutandmax_connection_ageand the "deprecation" ofexpire4. Does this introduce a backward incompatible change or deprecation?
This PR doesn't introduce a breaking change because an existing configuration would still work after applying this change.