-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Milestone
Description
There's been a long-standing TODO in net/http.Transport that says:
type Transport struct {
....
// TODO: tunable on global max cached connections
....
This bug is about that.
We already have Transport.MaxIdleConnsPerHost
, but it's been requested by many (and again recently) that we have a Transport.MaxIdleConns
for any host.
In the process, I also noticed that we're not aggressively removing cached connections when the peer server disconnects. We only lazily clean them up from the idle structures, which means we can hold onto memory for the bufio.Readers/Writers for a long time, wasting memory.
/cc @adg
brknstrngz and dmitshur