ASP.NET: Idle time out vs Session time out
Definition of Idle Time out:
“Idle timeout limits helps conserve system resources by terminating unused worker processes by gracefully closing idle processes after a specified idle duration. This allows you to better manage the resources on particular computers when the processing load is heavy, when identified applications consistently fall into an idle state, or when new processing space is not available.”
The value for session time out can be retrieved from:
Open IIS | Properties on the App Pool you are using | Performance tab Here you will see a setting that says: “Shutdown worker processes after being idle for 20 (time in minutes)” where 20 is the default.
Session time out defines:
The Timeout property specifies the time-out period assigned to the Session object for the application, in minutes. If the user does not refresh or request a page within the time-out period, the session ends.
The value for idle time out can be retrieved from:
Using Web.config
Using IIS
You can get to the setting by: Open IIS | Properties on Web Site | ASP.NET tab | Edit Configuration… (or Edit Global Configuration to change for more than one site) | State Management tab.
The deciding factor for idle time out and session time out are in most situation to depends on Session Time out values. The reason being is, if the time out value configured for idle is 10 minutes whereas session time out is 30 minutes, when the last user accessing the web application have been left idle for 10 minutes, your application will get recycled. All user whom are connected will get disconnected even before the session timed out. It is recommended to configure the idle time out to be the same as session time out to avoid such problem.
There’s another timeout which requires equal attention:
Script Timeout
This is the maximum time an .aspx page can run before timing out. It can be set in two places. Either the web.config (or machine.config for all sites) or via code using Script.ScriptTimeout. If you have debug enabled in web.config then the Server.ScriptTimeout is set to 30000000 seconds (or 347.2 days). Otherwise the default is 90 seconds. This setting is most important if you have long requests that need processing like file uploads, etc. In general the defaults are probably ok.
Using the web.config
This sets the timeout to 3 minutes.
Using code
Server.ScriptTimeout
Using IIS
You can get to the setting by: Open IIS | Properties on Web Site | ASP.NET tab | Edit Configuration… (or Edit Global Configuration to change for more than one site) | Application tab.
Here you will see a textfield with a label that says “Request Execution timeout (seconds):” with a default value of 110 seconds.
IMPORTANT NOTE: Be sure to uncheck the “Enable debugging” checkbox next to this field, otherwise, the value will be ignored and set to the 30,000,000 seconds that debugging defaults to.
Written by admin on April 3rd, 2012 with no comments.
Read more articles on Programming and Web.