I'm running a Tomcat 6.0.16 (native library is compiled )on a Linux box (CentOS 5), java version is:
java version "1.6.0" Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) The connection configuration is: <Connector port="8080" protocol="org.apache.coyote.http11.Http11AprProtocol" connectionTimeout="10000" enableLookups="false" maxKeepAliveRequests="1" maxThreads="500" minSpareThreads="5" maxSpareThreads="40" acceptCount="1000" /> I've deployed my wepapp into tomcat, which on low load (few requests per second) the doGet() method lasts about 30-40ms. In order to measure the performance of the webapp under load, I wrote a simple test that simulates high load on tomcat (hundreds of requests per second). After few seconds of running, the client received the following exceptions from the server (not all the requests, some of them processed and return response, but it took few seconds though): java.net.SocketException: Unexpected end of file from server at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:714) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:577) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:711) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:577) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1004) at AdvertiserCaller.call(StressTest.java:192) at AdvertiserCaller.call(StressTest.java:166) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) I've records the traffic using Wireshark (http://www.wireshark.org), and I've noticed that Tomcat send TCP Reset to the client, before it writes the reponse to the stream. Can you please assist understanding this behavior and tuning Tomcat in order to avoid these problems? Thanks, Barak.