Application Pool Properties– Worker Process Idle Time Shut down setting
From my past experience I have learned that most of the project teams are not aware of App Pool properties of IIS. They tend to rely on the default values of App Pool. Even though the default values are chosen to give better performance in general, the values might not be suitable for your project.
By default, as per the property in App pool setting, the worker process gets shut down after remaining idle for 20 minutes. One of the reasons for this 20 minutes shut down duration is,
In one of my recent projects, the customer asked me to resolve slow page loading issue. I asked him for the production IIS logs in order to find out the slow running .aspx pages. I sorted the pages based on the time-taken field in IIS logs and I was surprised to notice that /sitehome.aspx page was consistently clocking over 120 seconds.
Woo hoo… there you go! There problem is that, this application is being used by different customers across the world. Even though per day, only 10 customers access this application, however all of them reside in different regions. Obviously, they all have different business hours. Each time a new user hits the website, the IIS worker process has already timed-out and it has to restart. That’s the reason, for every user the /sitehome.aspx page was consuming over 2 minutes of time. Starting a worker process all over again is a time-consuming process.
I recommended the customer to increase the idle timeout value to something reasonable, say 120 minutes. Bingo! The /sitehome.aspx page consumes less than 15 seconds now.
Some details about this setting:
In an environment, where multiple websites are hosted on a same web server (IIS), it is important to conserve resources. Each IIS worker process instance consumes server resources such as CPU, memory, etc. Hence, if a particular IIS worker process is remaining idle over duration, one can shut it down so that other worker process instances get more CPU/memory.
However, if only one website is hosted on the web server (IIS), small idle timeout value might not be suitable. In the above scenario, the customer had 200 users across the globe and around 10-15 unique users visit the web application per day. Considering that around 1 or 2 user access the website per hour, if the request timeout is set to 1 or 2 hours, none of the users are going to face a situation where they have to restart the whole IIS process.