Udostępnij za pośrednictwem


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.

image

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,

Case Study:

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.

 

URL Time (ms)
\sitehome.aspx 149312
\sitehome.aspx 149228
\sitehome.aspx 149218
\sitehome.aspx 149046
\sitehome.aspx 148640
\sitehome.aspx 142984
\sitehome.aspx 140093
\sitehome.aspx 139609
\sitehome.aspx 138562
\sitehome.aspx 130703

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.

Comments

  • Anonymous
    November 12, 2008
    Hi, Well, coming from 2 min. it is a great improvement, but 15 sec is still a very long time to load. Why don't you try disabling the idle time and schedule a recycle on a quiet moment. And use a ping tool to keep the site alive. All together can bring you a 1 or 2 sec. loadtime and a happy customer.

  • Anonymous
    November 15, 2008
    Actually, 15 seconds time is consumed in processing and executing some SPs on SQL server. Thanks.

  • Anonymous
    March 26, 2012
    " 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." :D then why not simply dissable the idle shutdown all together and use recycling instead.