-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
HTTP2 Max Streams aware client pooling #3623
Comments
Hey there @howardjohn, If I understand correctly, you'd like to see how many streams are currently open? |
Ideally the current and the configured max streams on the connection - the max is dynamic based on the client/server SETTINGS. Without this we end up blocking when we have two many long lived requests to the same host |
@howardjohn have you considered using an atomic counter that a structure increments or decrements when it is created and dropped to track the count? |
Yes, that is our current workaround. However, that only enables us to know how many active streams we have produced as a client. We cannot find the negotiated max streams on the connection because its not exposed by hyper. So today we are guessing no one will set it <100... but there is no guarantee, and it makes us extremely conservative |
That's a fair ask. I'll get into it as soon as I have time to spare. |
Is your feature request related to a problem? Please describe.
We are dealing with an issue where pooled http2 connections are hanging due max streams limits. This is problematic for us, as all our streams are very long lived, so they end up ~indefinitely blocked.
We were hoping to get around this by tracking stream counts as part of the pool logic.
However, neither
current
ormax
stream counts are exposed.Would it be feasible to expose those (at least Max - current can be tracked in our own code)?
Or is there an alternative solution we should look into?
Previous discussion brought up
Describe the solution you'd like
A few options are plausible.
fn is_open() { self.current() < self.max() }
Additional context
Here is our current pool: https://github.com/istio/ztunnel/blob/a0d539ee6b395a823c31db8f382048dc1947bcb7/src/proxy/pool.rs#L68
Basically we are operating on
http2::SendRequest
sSome other libraries built on
h2
expose similar: https://github.com/cloudflare/pingora/blob/20fd391f3e78c9349149f11fae94da9e4657478e/pingora-core/src/connectors/http/v2.rs#L239The text was updated successfully, but these errors were encountered: