Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Java web application running om Tomcat 7 with an Apache httpd 2.2 fronting with mod_jk/AJP.

One part of the application is serving files (up to 4mb size). Now, normally this all runs very smooth with stable, low response-times. However, in rare instances (<0.1% of downloads), the downloadtime will go beyond 1 minute. After activating the ThreadStuckValve in Tomcat, I can see that the long responses seem to be stuck at

org.apache.tomcat.jni.Socket.sendbb(Native method)

i.e network I/O. At most, these long-running downloads take 5 minutes, which I strongly suspect is because of the default 300 second timout in Apache 2.2 (, "TimeOut directive").

To me, this looks like network problems. The Apache timeout (if that is what is kicking in at the 5 minute mark) indicates that ACK packets are not being transmitted correctly. My questions are what could be causing this? Closed browser at receiving end but socket not signaled as closed properly? Packet loss or some other network failure in transit? Where would I start troubleshooting this?

We're running Tomcat and Apache on Windows server 2008-R2 in a vmware virtualized server.

share|improve this question

I would start by running Wireshark and confirming your theory that the clients are misbehaving. If that's the case, there's not a lot you can do to prevent that, but you can add intelligence to close these connections on your side more aggressively (both at Tomcat and Apache).

It's also worth noting that if this sort of misbehavior has significant impact on your application, you are susceptible to some simple DoS attack vectors (Slowloris comes to mind as one possibility, though something that makes it down to your application and disappears might be more effective).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.