Killing CLOSE_WAIT sockets without killing parent process on Linux

I believe CLOSE_WAIT on the server side of the connection means that the server has received a FIN from the client, will have acknowledged this back to the client and then informed the application that it can close the connection.

It is then up to the application to relinquish the connection once it is satisfied that all the data has been read from the connection.

Once it relinquishes the connection the server will send a final FIN back to the client and the connection will be fully closed.

Suggests it has nothing to do with "TCP_tuning"

Are you sure your application is closing the sockets?

When i wrote a python server, i learnt this :D

UPDATE
Depending on your Tomcat version, you may have experienced this problem due to a bug introduced in Tomcat 6 with the keepAliveTimeout feature in Coyote's AJP protocol.
The nature of this problem was caused by Tomcat failing to close sockets after the keepAliveTimeout expired. The Tomcat sockets would remain in a CLOSE_WAIT state but the corresponding mod_jk sockets would close as normal.

his bug was fixed in SVN commit r589062 and released in Tomcat 6.0.15