We help IT Professionals succeed at work.

HTTPS error 413 (request entity is too large) when using SSL


We are getting an error "The page was not displayed because the request entity is too large" on our new web server.

After much testing we have found a way to reproduce the error with 100% certainty. The tests were run with the latest version of Internet Explorer as well as Firefox (both running on Windows 7).

The error only happens when the following three conditions are met at the same time:
1. The error only shows up if the page is viewed as HTTPS (SSL)
2. The error only shows up if the page is above a certain size. If the test page contains a textbox with a string of around 40Kb size the error never happens. If the test page contains a textbox with a string of around 50Kb size the error always happens.
3. The error only shows up if the user waits at least 60 seconds before doing a postback.

Windows server 2008 R2 (64 bit) running IIS 7.5.
Website ASP.NET 3.5

We have changing the uploadreadaheadsize in the following way: "cscript adsutil.vbs set w3svc/1/uploadreadaheadsize 204800" but it has not fixed the issue. The applicationHost.config under 'C:\Windows\System32\inetsrv\config' shows <serverRuntime uploadReadAheadSize="204800" /> so the change is reflected there.

The default size for UploadReadAheadSize is 49152 which explains perfectly why we are seeing the error when the page size is 50Kb and why we are not seeing the error when the page size is 40Kb. It is as if the change to the UploadReadAheadSize never took effect.

I'm starting to think this might be an IIS 7.5 issue and that the above change to UploadReadAheadSize only affects IIS 6.0.  However, in that case I'm not sure how to change UploadReadAheadSize for IIS 7.5.

Thanks for your help!
Watch Question

We figured this one out. I'm posting the solution here in case someone runs into the same problem.

The command:

cscript adsutil.vbs set w3svc/1/uploadreadaheadsize 204800

affects the default website ( the /1/ part of the argument). In our case the running website was site 3 so the command should have been

cscript adsutil.vbs set w3svc/3/uploadreadaheadsize 204800

You can find your websites index by looking inside


under the <sites> tag


I am running in to same set of issues with my asp .net application also. i have followed these steps towards resolution but i still have problem with the application. After waiting for about 60 seconds as mentioned in the initial thread, i get request entity too large exception.
My application is deployed in a load balancing environment. i am not sure if this can cause a problem.

I have executed above mentioned command in both my web servers.

One strange thing i have been noticing was: when i have only 1 server up in production, this problem never occurred. However, when i have both the servers up in a load balancing environment, i see this problem.

Is there some kind of persistence issue with load balancer? I have sql server session handling in my application so this wudn't be because of sticky session too. I have same machine key set in both my web servers. Problem still persists. Any quick help would be appreciated.

Kishan G K