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