Avoid significant connections in TIME_WAIT (#5555)
MaxIdleConns limits the total number of connections kept in the pool for re-use. In addition, MaxIdleConnsPerHost limits the number for a single host. Since minio gateways usually connect to the same host, setting `MaxIdleConns = 100` won't really have much of an impact since the idle connection pool is limited to 2 anyway. Now, with the pool set to a limit of 2, and when using the client heavily from 2+ goroutines, the `http.Transport` will open a connection, use it, then try to return it to the idle-pool which often fails since there's a limit of 2. So it's going to close the connection and new ones will be opened on demand again, many of which get closed soon after being used. Since those connections/sockets don't disappear from the OS immediately, use `MaxIdleConnsPerHost = 100` which fixes this problem.master
parent
25107c2e11
commit
db9e83de62
Loading…
Reference in new issue