Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to configure the Application Pool's "Idle timeout" in web.config?

I know one can set the session timeout. But, if the application itself has received no requests for a given period of time, IIS shuts down the application.

This behavior is configurable in the IIS management console, and I know how to do this. Still, I wonder if it is possible to configure this in web.config.

like image 243
Martin Kool Avatar asked Mar 09 '09 09:03

Martin Kool


People also ask

How do I set idle timeout in web config?

config under processModel section: idleTimeout: Specifies the period of inactivity, in the string format hr<tt>:</tt>min<tt>:</tt>sec, after which ASP.NET automatically ends the worker process. Example: <processModel enable="true|false" timeout="hrs:mins:secs|Infinite" idleTimeout="hrs:mins:secs|Infinite" ..


2 Answers

Not in IIS 6. In IIS 6, Application Pools are controlled by Worker Processes, which map to a Request Queue handled by HTTP.sys. HTTP.sys handles the communication with the WWW Server to determine when to start and stop Worker Processes.

Since IIS 6 was created before .Net, there's no communication hooks between .Net and the low-level http handlers.

ASP.net is implimented as an ISAPI filter, which is loaded by the Worker Process itself. You have a chicken-before-the-egg issue if you are looking at the web.config controlling a worker process. This is primarily why MS did the major re-write of IIS 7 which integrates .Net through the entire request life-cycle, not just the ISAPI filter portion.

like image 130
Christopher G. Lewis Avatar answered Sep 19 '22 14:09

Christopher G. Lewis


You can edit these settings, but not in web.config. If you have IIS7, the setting is in applicationHost.config, and the key attribute is the shutdownTimeLimit.
You can google for it, to find out how to use appcmd and other tools to set or change it.

Example

Also you can directly modify the shutdownTimeLimit by editing the applicationHost.config file, which is in the \inetsrv\config directory.

The schema for the applicationHost.config file is in the \inetsrv\config\schema\IIS_schema.xml file.
So open it in your favorite schema-aware XML editor and you'll get intellisense, etc.

like image 42
Cheeso Avatar answered Sep 20 '22 14:09

Cheeso