Go Transport中的keep-alive TTL永远不会关闭连接

I have an application hosted on AWS which is running on Production creates an http server as mentioned in the below sample code. There is default timeout of 180 seconds in the go library. So, ideally connections not used should be closed after 180 seconds.

myMux := http.NewServeMux()
myMux.Handle("/SOME_PATH", appHandler{myHandler})
err = http.ListenAndServe(viper.GetString("handler.port"), myMux)

The problem is when traffic increases on the application, number of connections increases. But when traffic comes down number of connections remains same.

I am using go version go1.10 linux/amd64 and this application is behind Amazon ALB.

Edited question:

As you can see the rate at which connections are decreasing is very slow when application is behind ALB. So, what could be the problem enter image description here

When you setup your server you should add timeouts appropriate for your application, for example

srv := &http.Server{
    ReadTimeout:  5 * time.Second,
    WriteTimeout: 20 * time.Second,
    IdleTimeout:  180 * time.Second,
    Handler:      myMux,
}

With this the idle connections should get turned off. If it's an upstream load balancer sending health checks on that many connections the solution would be different.