I am experiencing a request timeout from IIS when I run a long operation. Behind the scene my ASP.NET application is processing data, but the number of records being processed is large, and thus the operation is taking a long time.
However, I think IIS times out the session. Is this a problem with IIS or ASP.NET session?
If you want to extend the amount of time permitted for an ASP.NET script to execute then increase the
Server.ScriptTimeoutvalue. The default is 90 seconds for .NET 1.x and 110 seconds for .NET 2.0 and later.For example:
This value can also be configured in your
web.configfile in thehttpRuntimeconfiguration element:Please note according to the MSDN documentation:
If you’ve already done this but are finding that your session is expiring then increase the
ASP.NET
HttpSessionState.Timeoutvalue:For example:
This value can also be configured in your
web.configfile in thesessionStateconfiguration element:If your script is taking several minutes to execute and there are many concurrent users then consider changing the page to an Asynchronous Page. This will increase the scalability of your application.
The other alternative, if you have administrator access to the server, is to consider this long running operation as a candidate for implementing as a scheduled task or a windows service.