Diagnosing "Request timed out" HttpExceptions

Jarrod Dixon picture Jarrod Dixon · Jan 14, 2009 · Viewed 22.1k times · Source

Here on StackOverflow, we're seeing a few "Request timed out" exceptions every day.

The facts:

  • Request timeout is the default 90 seconds
  • Occurs only on POSTs
  • Data posted is text, usually small (< 1KB), but can range to a few KB
  • No Form data is captured in server variables
  • Client UAs are diverse: IE5.5 - 7, Firefox 3.0.5, iPhone, Chrome
  • Client locations are diverse: UK, France, USA - NC, OH, NE, IN

We've tested a server-based timeout (i.e. using Thread.Sleep) and all form variables are correctly captured in the exception log - this leads us to believe the client is having issues sending the request in the allotted time.

Any thoughts on how to trap/debug this condition are very welcome!

Answer

Barry Hagan picture Barry Hagan · Apr 2, 2009

I've got the same problem on our production servers that use a small AJAX webservice. After doing packet captures outside our firewall, we found that the POST to the service was coming in two TCP segments and the second segment never got to us. (first packet only contains headers, the second missing packet should be the json body) So basically IIS is just sitting there waiting for the rest of the POST. After the configured timeout, the server sends a RST packet to the client and logs the "Request timed out" error - which is correct behavior.

We are trying to get a client repro without much luck, but in our case this appears to be completely network related (or possibly some "security" software that doesn't like the contents of the post).