tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurent Petit <>
Subject Issue with keep-alive connections, when using APR Connector on Windows and starting Processes from Servlets
Date Wed, 20 Jun 2012 14:19:03 GMT

I have a problem with keep-alive connections, when starting a subprocess
(via JDK's default ProcessBuilder/Process API), while also having
started Tomcat with the APR HTTP/1.1 Connector.

The problem symptom is with Keep-Alive connection, as follows:

- the client (browser, jmeter, etc.) sends a first request
  - the servlet starts a Process for e.g. wordpad.exe
  - the servlet returns an acknowledgment html content, sets the content
length, flushes the writer, and returns
- the client displays the received acknowledgement html content, sends
the second request to the server.
- the server doesn't answer. No Tomcat log ever reports the start of
something received.
- Then when on the server you close the wordpad.exe instance, the server
finally handles the second request.

I have created a small servlet code which reproduces the problem.
For the demo, it suffices to have the started subprocess be
"wordpad.exe". Of course my real process is more interesting than
that :-).

You can find the servlet code for reproducing the test here:

To reproduce the problem deterministically, the ConnectionTimeout for
the APR HTTP Connector in servlet.xml must be set sufficiently low.
With my boxes, I get a 100% error hit when set at 200 ms.

You can find here the jmeter script which hits the same page again and
again with "keep-alive" option set on:

So far, the only reliable solution we have found to work around this
problem is to not use the HTP/1.1 APR Connector.

My configuration :
Windows 2008 US std R2 64bits
Tomcat 6.0.32 64 bits
Java 6u30 64 bits(Oracle)

Same issue has been observed on Windows 7 32 bits.

Was not able to reproduce the issue on Linux Ubuntu Desktop 11.10 or

Thanks for your support, ideas, solutions, etc.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message