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
John in md
source share