I am currently facing an issue in my load environment during the load testing. The description of the issue is given below,
We have a Jersey REST application which is being guarded by a GO application. GO app validates the browser cookie and creates a single host reverse proxy and serve the request if its a valid one, Initially we got the below error
http: proxy error: dial tcp HOSTNAME:PORT can't assign requested address
Even after upgrading it to 1.6, the same issue is happening but GO App log shows the below error
"http: proxy error: net/http: request canceled"
I've enabled the DisableKeepAlives and performed the load testing and the same issue is happening, Now Go app shows the below errors.
http: proxy error: dial tcp HOSTNAME:PORT: i/o timeout
http: proxy error: net/http: request canceled
Code snippet for creating proxy is given below
We use proxy.ServeHttp after we validate the request. Normally the above proxy error is not occurring suddenly but it occurs after 2 or 3 hours after which load testing is started
After disabling keep alive connection, we see lots of TCP connecion in TIMED_WAIT state but its not getting closed but the application is hanging and see the proxy error in the log.
So we have to either call https://golang.org/pkg/net/http/#Transport.CloseIdleConnections or increase MaxIdleConnsPerHost to some higher value to fix this issue.
Thanks Shawn. Increasing the maxidleconnectionperhost is my next option. Will there be any issue due to increasing this?