Friday, 6 September 2013

HTTP 413 error in ASP.NET + IIS 6.0, running out of potential solutions

HTTP 413 error in ASP.NET + IIS 6.0, running out of potential solutions

I am troubleshooting an old legacy ASP.NET application running on IIS 6 +
Windows 2003. The app has several pages that poll the server
asynchronously in order to refresh datagrids using the System.UI.Web.Timer
and sends a lot of viewstate back with each request (way too much imo, but
i can't do anything about that just yet) These polling refreshes are
experiencing intermittent HTTP 413 codes, and I cannot figure out why.
What I have done so far is to ensure that maxrequestlength and
uploadreadahead size (the appliation is using client cert authentication)
have been configured for the appropriate node in the metabase, but the
error keeps happening. Monitoring the request data w/ firebug, I can see
that the size of the post body being sent is well below either of the
configured sizes. In addition, it is probably worth mentioning that this
application allows the upload of images to its server (over https) that
are well over the size of the data being sent by these asynchronous
requests (2-5 mb on average), and these uploads work without issue.
The strange part is that the amount of data required to cause the 413
varies. A request that sends 160000 Bytes might get through just fine, and
the next request at ~ 158000 bytes will fail with a 413. I've taken into
consideration both total request size and just the size of the entity
being sent, and the variation still exists.
The second strange thing is that if an asynchronous postback starts, and
then is aborted because another request is initiated (i.e. clicking a sort
column in the datagrid twice), the 413 is guaranteed to happen, and each
asynchronous request after that will fail with a 413 although sometimes,
after some seemingly random period of time, the requests made by the timer
will start working again without the 413 error, even though they are often
EXACTLY the same size as the previous requests that failed (and I mean
exactly down to the byte).
I am primarily a Java developer so I am not extremely familiar with the
ASP.NET (3.5) + IIS 6 environment, but there seems to be something going
on here besides the request simply being too large.
Any help / pointers / links / whatever would be greatly appreciated.

No comments:

Post a Comment