How to Set Classic ASP Request and Response Limits

Upload size and response-buffer size are different limits. Increasing both to two billion bytes obscures the actual requirement and can make resource consumption much worse. First determine whether the failure happens while receiving a request or generating its response.

Read the effective limits

In elevated Windows PowerShell on the server:

PowerShell
$appcmd = Join-Path $env:windir 'System32\inetsrv\appcmd.exe'
$appPath = 'Default Web Site/Demo'
& $appcmd list config $appPath /section:system.webServer/security/requestFiltering
& $appcmd list config $appPath /section:system.webServer/asp

requestLimits.maxAllowedContentLength is the request-filtering cap. limits.maxRequestEntityAllowed belongs to Classic ASP's request handling. limits.bufferingLimit bounds the ASP response buffer. These settings use bytes.

Apply only the required change

For a test application whose complete request body may be at most 10 MiB, configure both relevant request layers:

PowerShell
& $appcmd set config $appPath /section:system.webServer/security/requestFiltering /requestLimits.maxAllowedContentLength:10485760 /commit:apphost
if ($LASTEXITCODE -ne 0) { throw 'Request-filtering update failed.' }
& $appcmd set config $appPath /section:system.webServer/asp /limits.maxRequestEntityAllowed:10485760 /commit:apphost
if ($LASTEXITCODE -ne 0) { throw 'ASP request-limit update failed.' }

Re-run the read commands and confirm both values. Multipart form boundaries and fields count toward the complete request body, so a 10 MiB file can exceed a 10 MiB request limit.

Change response buffering only if a measured response needs it. For an 8 MiB test buffer:

PowerShell
& $appcmd set config $appPath /section:system.webServer/asp /limits.bufferingLimit:8388608 /commit:apphost

Exercise both sides of the boundary

Send a known-valid request just below the selected body limit and one just above it to a disposable test endpoint. Verify the accepted request reaches the application and the rejected request is logged at the expected layer. Different layers can return different errors, so inspect the substatus rather than expecting one universal status code.

Also check reverse-proxy limits, application validation, timeouts and concurrency. A larger IIS cap cannot override a smaller upstream cap. Restore recorded settings after the test if the change is not being retained.

References

ASP Limits <limits>
Overview The <limits> element of the <asp> element specifies the following Active Server Pages (ASP) connection and queue limits for Internet Inf...
https://learn.microsoft.com/en-us/iis/configuration/system.webserver/asp/limits/
ASP limits
Request Limits <requestLimits>
Overview The <requestLimits> element specifies limits on HTTP requests that are processed by the Web server. These limits include the maximum size of a...
https://learn.microsoft.com/en-us/iis/configuration/system.webserver/security/requestfiltering/requestlimits/
Request filtering limits

Author: Herman Schoenfeld