You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Jayaram, Deepak" <dj...@verisign.com> on 2007/03/21 12:08:14 UTC

Keep Alive in tomcat 5.5.20

Can someone point me to the settings/guidelines required to keep socket
connections alive?
 
The documentation clearly says that maxKeepAliveRequests if not
specified is 100 by default. However, when I do a netstat -a, during
intermittent client calls, I do not see any ESTABLISHED sockets.
I have deployed a simple servlet that returns a 200 OK in the doPost.
The client code does some POSTs, sleeps for a while and does some POSTs
again. During the sleep I am seeing the sockets in TIME_WAIT state while
I would have expected to see them as ESTABLISHED.
 
Few things that I have tried/verified:
1) The "Content-Length" header is correctly passed by the client code
2) The Client code creates HttpURLConnection objects, sets request
parameters, calls connect(), but does not call disconnect(). I have also
tried writing a CRLF after the POST body as I read in an earlier thread
that some browsers signal end of post using CRLF.
3) A "Connection: keep-alive" header is passed by the client.
4) Added -Dhttp.keepAlive="true" to the java run options in catalina.sh.

5) Explicitly specified a maxKeepAliveRequests.
 
~DJ