I have a java gateway application deployed as tomcat web application on server 1 and server 2 which are client facing load balanced servers.
This app communicates with another webapp deployed on server 3 and 4 which are also load balanced.
During high volume times or when there is a connection failure to backend core systems from app(server 3 and 4) , the gateway app is logging 'java.net.SocketException: Connection reset'.
For 10 requests, couple of requests gives 'Connection reset' on the client server.When this is happening there are absolutely no issues on the server side application.Sometime when there is more failures the app(Server 3 and 4) hangs and needs to be restarted.
Any inputs would be much appreciated.Thanks in advance.
After performance testing was done on our application , the result showed that after multiple concurrent requests the application was stalling to create HttpClient objects.
I ended up using "ClientConnectionPoolManager".(Maintains a pool of HttpClientConnections and is able to service connection requests from multiple execution threads. Connections are pooled on a per route basis. A request for a route which already the manager has persistent connections for available in the pool will be services by leasing a connection from the pool rather than creating a brand new connection) and this seems to manage the connections effectively.
Thanks.