Outlets at CLOSE_WAIT by Jersey Client

I use jersey 1.4, ApacheHttpClient and the Apache MultiThreadedHttpConnectionManager class to manage connections. For the HttpConnectionManager I set staleCheckingEnabled to true, maxConnectionsPerHost to 1000 and maxTotalConnections to 1000. Everything else is the default. We work at Tomcat and connect to multiple external sites using the Jersey client.

I noticed that after a short period of time I will start to see sockets in the CLOSE_WAIT state that are associated with the Tomcat process. Some observation with tcpdump shows that external nodes seem to close the connection after a while, but do not close on our side. Usually, there is some data in the socket read queue, often 24 bytes. Connections use https and the data seems to be encrypted, so I'm not sure what it is.

I checked to make sure that the created ClientRequest objects are closed. Sockets in CLOSE_WAIT seem to be recycled, and we don't have enough resources, at least at this time. I am not sure what is going on on external servers.

My question is, is this normal I should be worried about?

Thanks,

John

+7
source share
1 answer

This device, such as a firewall or a remote server, is likely to issue a TCP session timeout. You can analyze the capture of HTTPS packets using Wireshark, as described on their SSL page:

http://wiki.wireshark.org/SSL

The staleCheckingEnabled flag only gives a check when you go to the actual use of the connection so that you do not use network resources (TCP sessions) when they are not needed.

+1
source

All Articles