Application Pool in IIS

In this article we’ll explain you about Application Pool in IIS and its role.  If you have not checked our previous articles on IIS, then please check out “What is IIS” before proceeding with current one. After reading this article you will be able to know the following questions:

What is Application pool in IIS?

Application pools form an important part of an IIS. We can say it as a heart and soul of IIS server. It contains various settings which helps us in managing and serving applications in better way.

What is Role of Application Pool in IIS?

 “Application pool “plays very important role in web site hosting. Ideally you should create separate app pool for each web site instead of using the existing one or default app pool. Separate app pool will help you configuring it as per your needs, and ultimately your application will run faster and smoother.  If you will use the common App pool shared with other website too and if any website is doing memory leaks or doing heavy calculation, then there are maximum chances that current application will use more CPU and memory, and which ultimately kill the performance of your website because they are sharing the common app pool and same worker process. 

Below in this article we’ll explain key settings which you can do in “Application pool” so that your application can run in faster and in better way.

Note: Type inetmgr command in RUN window, if it opens IIS window then it already exists on your machine else you need to install it using the steps given in previous article HERE.

  • Please run “inetmgr” command in RUN window to open IIS. If command did not work, please install it using article (Guide to Install IIS on window). 
Role of App Pool in IIS

How to add Application pool in IIS?

Right click on “Application pool” and select “Add Application Pool” as shown in below given screen shot.

Role of App Pool in IIS

Now you can give appropriate name to your application pool and can select the CLR version as per your need is and click OK button. Please note it is CLR version not Dot net version. If you are not sure select anyone it can be changed later on using advanced setting options. We’ll discuss “advanced setting options” later in some other article (App pool advance settings).       

Role of App Pool in IIS

Next you can also select “Managed pipeline Mode” as given below. Earlier IIS 6 versions only Classic mode was there and in later versions “integrated mode” was introduced.

Role of App Pool in IIS

Next you can open the ”Advance settings” option (from point no-1 link) and can make the required changes in the “App pool” settings.

Role of App Pool in IIS
  • After configurations update, please do not forgot to assign this new application pool to your website. Right click on website and select the “Advance setting option” as shown below.
Role of App Pool in IIS

Where can we change application pool?

In below window you can see “Application Pool” option. Click on three dots on right side (as appearing below) a window will open where you can change Application pool and can select the desired one as per the need. 

Role of App Pool in IIS

How to Control CPU usages in application pool?

CPU limit percentage – Under this option we can restrict the CPU usage that specific Application pool can use. 0 or 100 means 100% CPU can be used but we can give percentage here like 50. Using this CPU usage will not go above the defined limits.

When CPU usages will approach threshold value or go beyond specified limit, we can set some action from “Limit Action” option which is just below Limit (Percent).

Application Pool in IIS

How to Control memory usages in application pool?

Under application Pool’s advanced settings there is one option named Recycling which can be used to manage the memory usage of specific Application pool. You can apply Recycling Settings on required worker processes and once it will hit that limit, a new worker process for the same pool will be created that it will take care of executing all incoming requests. Check complete description HERE.

For getting the details of “Advance settings” option in Application pool please check out another article “IIS App pool Settings“. You can also check our below video for detailed explanation.

Why do we need app pool in IIS?

OR

What does an application pool in IIS do?

Application pools increases the reliability and manageability of our web infrastructure. We can also choose/used default application pool, but it is best practice to create separate application pool for each application. Every application pool serves as a container for selected applications and other applications has no impact on our application if we’ll use separate application pool.

What is max pool size in IIS?

Its value can vary between 64 and 256. You cannot set more than 256 IIS threads under this setting.

Application Pool stopped but cannot start again.

If your ‘Application Pool‘ is not starting again then to solve this problem, you can open Services window and confirm whether “Windows Process Activation Service” (WAS) is running or not. It should be in running state.

Application Pool in IIS

Application pool troubleshooting (Important points)

If you are facing issue with “Application Pool” then you can try the following points, hopefully these will help you solving the issue.

  • Check and change the “Application Pool” recycle settings.
  • Recycle your “Application Pool”.
  • Restart “Application Pool” or your website.
  • Increase “Application Pool” queue-length limit.
  • Configure “rapid fail” protection.
  • Check IIS logs for getting details of error.
  • Disable IIS redirection rules for trouble shooting purpose only. (If present in Web.config )
  • Disable “Custom Error” configuration in web.config to get more detailed error.

Check Out Complete Video on ‘Application Pool’.

I hope with the end of this article you got the understanding about the role of IIS and how to control the CPU & Memory usages. You can also check Application Pool Identities.