Skip to content
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

proposal: net/http: expose statistics about the client connection pool #63494

Closed
glenjamin opened this issue Oct 10, 2023 · 1 comment
Closed
Labels
Milestone

Comments

@glenjamin
Copy link

At present, Go's http.Transport struct implements a connection pool with a few tunable parameters to manage the lifecycle of connections within this pool.
Unlike the similar connection pooling behaviour of sql.DB, there is no (first-class) way to access statistics about how many connections are active, idle or waiting.
This makes it quite difficult to figure out what the optimal numbers for connection limits, idle limits and idle timeouts should be.

I found this issue which suggested something in that general direction, but it begins with a solution rather than a problem statement.

There is also this package which implements such tracking via a a custom DialContext to infer the state of the pool - although it appears to be now be unmaintained.

I think an API similar to sql.DB's Stats() method would suit my needs, but it may be that others have drawn lessons from that implementation which they would prefer not to repeat?

@gopherbot gopherbot added this to the Proposal milestone Oct 10, 2023
@seankhliao
Copy link
Member

This is currently being discussed in #61638
For now, please make your points there.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants