-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mohit,

Mohit Anchlia wrote:
> So I tried all the options. I also changed the code to use connection
> pooling with only 2 connections but still there are bunch of
> CLOSE_WAITS. As soon as I stop tomcat all of them go away. I am not
> able to figure out why there are so many CLOSE_WAITS hanging around
> when I just have 2 connections in my pool.

These are mostly HTTP connections to localhost, right? Maybe you are
using connection timeout options that are too long for your quick
transactions. CLOSE_WAIT is a normal TCP state, but if these polie up on
top of each other because of long (minutes?) timeouts then you can
easily run out of file handles (socket ~= file handle, which is why you
are getting the "too many open files" error).

Consider setting some of these timeout options on HttpClient (if such
options exist) or researching the defaults for these options. Also, make
sure you are cleaning up after your connections appropriately (properly
catching IOExceptions, closing connections in finally blocks, etc.). If
connections are closing unexpectedly, they may be sitting in CLOSE_WAIT
longer than necessary.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjvqzkACgkQ9CaO5/Lv0PA8dgCdHtFiD0gquai4yEBXOKdZFOrm
bsEAoKOXMxo+u5I1EW2MQPuWvLJGhEYe
=m2kr
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to