Background While I was developing my ChatPilfer hacking tool I found myself needing to make some modifications to the default Go HTTP Transport. This post marks the beginning of looking at the Golang HTTP Transport and what behaviors I found that were interesting and worth exploring further. Today we are starting with the MaxIdleConnsPerHost, its behavior in a concurrent environment, and how that can impact scaling. HTTP connection pooling can be a great boon to application performance. There is a real cost required when setting up a new HTTP connection. First dealing with DNS, then a TCP handshake, then probably a TLS handshake, and then finally the packets are allowed to flow. So once that connection is established we don’t want to have to go through that same process over and over again when talking to the same service. Thus connection pooling comes in where pooled connections are kept idle so that they can be reused for the next request to that same host, or until the connection reaches its IdleConnTimeout and is closed. ...