{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/13801","labels_url":"https://api.github.com/repos/golang/go/issues/13801/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/13801/comments","events_url":"https://api.github.com/repos/golang/go/issues/13801/events","html_url":"https://github.com/golang/go/issues/13801","id":124590589,"number":13801,"title":"net/http: transport MaxIdleConnsPerHost  does not work as expected","user":{"login":"sschepens","id":3072509,"avatar_url":"https://avatars.githubusercontent.com/u/3072509?v=3","gravatar_id":"","url":"https://api.github.com/users/sschepens","html_url":"https://github.com/sschepens","followers_url":"https://api.github.com/users/sschepens/followers","following_url":"https://api.github.com/users/sschepens/following{/other_user}","gists_url":"https://api.github.com/users/sschepens/gists{/gist_id}","starred_url":"https://api.github.com/users/sschepens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschepens/subscriptions","organizations_url":"https://api.github.com/users/sschepens/orgs","repos_url":"https://api.github.com/users/sschepens/repos","events_url":"https://api.github.com/users/sschepens/events{/privacy}","received_events_url":"https://api.github.com/users/sschepens/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/34","html_url":"https://github.com/golang/go/milestones/Go1.6Maybe","labels_url":"https://api.github.com/repos/golang/go/milestones/34/labels","id":1425772,"number":34,"title":"Go1.6Maybe","description":"Maybe this will happen for Go 1.6.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":32,"closed_issues":4,"state":"open","created_at":"2015-11-23T18:39:45Z","updated_at":"2016-01-03T03:22:54Z","due_on":"2016-01-31T05:00:00Z","closed_at":null},"comments":2,"created_at":"2016-01-02T13:24:12Z","updated_at":"2016-01-04T18:39:07Z","closed_at":null,"body":"I recently had an issue which made Go consume all ephemeral ports and start failing to do requests.\r\nThe problem was triggered because I was doing 10 concurrent requests with the DefaultMaxIdleConnsPerHost so Transport was only reusing 2 connections and closing the other 8 as soon as a request was finished, just to reestablish a connection again.\r\nThis seems a really bad behavior and never happened to me on any other language or http client.\r\nA connection is usually considered idle when it was not used for a period of inactivity, maybe a whole keepalive period or so, not after a request has been sent successfully.\r\nThe behavior one would expect is to have 10 established connections and, after say 30 seconds of not issuing any request having only 2 connections established as per DefaultMaxIdleConnsPerHost.\r\n\r\nHere is a [gist](https://gist.github.com/sschepens/062c7dbdf29272eea4af) that triggers this behavior.\r\n\r\nI'm running go 1.5.2 on Ubuntu Precise 12.04, kernel: Linux e-0000e768 3.8.0-44-generic #66~precise1-Ubuntu SMP Tue Jul 15 04:01:04 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/168763010","html_url":"https://github.com/golang/go/issues/13801#issuecomment-168763010","issue_url":"https://api.github.com/repos/golang/go/issues/13801","id":168763010,"user":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T18:39:06Z","updated_at":"2016-01-04T18:39:06Z","body":"This has been like this forever, so it's not Go 1.6 material. It's also somewhat involved.\r\n"}}