Hello John,
I found similar question on apache http client forum, see [1]. It
contains solution to, so you can try it and let others know whether it
works for you..
Regards,
Pavel
[1]
http://old.nabble.com/tcp-connections-left-with-CLOSE_WAIT-td13757202.html
On 1/10/11 3:53 PM, John Metz wrote:
> Hi,
>
> I am using Jersey 1.4, the 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 default. We are running in Tomcat and making
> connections out to multiple external hosts using the Jersey client.
>
> I have noticed that after after a short period of time I will begin to
> see sockets in a CLOSE_WAIT state that are associated with the Tomcat
> process. Some monitoring with tcpdump shows that the external hosts
> appear to be closing the connection after some time but it's not
> getting closed on our end. There usually some data in the socket read
> queue, often 24 bytes. The connections are using https and the data
> seems to be encrypted so I'm not sure what it is.
>
> I have checked to be sure that the ClientRequest objects that get
> created are closed. The sockets in CLOSE_WAIT do seem to get recycled
> and we're not running out of any resources, at least at this time.
> I'm not sure what's happening on the external servers.
>
> My question is, is this normal and should I be concerned?
>
> Thanks,
>
> John
>
>
>
>