Saturday, May 3, 2008

Configuring session time out on IIS at MS OSs



There are totally 5 setups that influence your timeout. All of those are discussed here.







1. Web.config file of Application: First one to influence timeout is Session timeout setting in your we.config file.












Note: Web.config file is inherited to the subfolders and subfolders config settings take the precedence in case they exist.






2. Application session timeout in IIS: Go to IIS, right click on the web application, go to properties. Go to Directory tab, click on Configuration button. Application configuration tab opens, click on Options tab as in the screenshot, you will find enable session state. Change the session time out period here.






3. Default website session timeout in IIS: Right click default web site under IIS and choose Home directory tab. Click on configuration button to open application configuration. Choose options tab and you will find Enable session state again similar to session state of each application. Enter higher session timeout period which will be application to all sites in the webserver.






4. Change Worker process idle timeout of application pool (Server Specific)– Shutdown worker process after being idle for (time in minutes) – Default is 20 minutes. This setup is applied for all websites that use this application pool. To change this, Right click on the required application pool, choose Performance tab, and change the duration of idle time or uncheck the option so that the process is never recycled. You can also create an application pool, configure it, and use it for a selected list of web applications.






5. Change Recycle timeout period of application pool(Server Specific):– Right click on application pool or default application, and choose Recycling tab. Change the “Recycle worker process (in minutes)” option to either change the period or disable the option by un checking. Un checking this option may be a good idea from performance point of view.







And finally there is a last one in machine.config file. But that does not affect any of these configurations and these setups take the precedence





With ASP.Net enabled IIS use ASP.Net tools.