1) What is an Application Pool?
Application pool is a collection of one or more websites running as a single process called w3wp.exe with a single identity.
Application pools provide encapsulation among hosted web applications so that any applications that are running outside a given application pool cannot affect the applications in the application pool. You can have multiple websites running under a single application pool, but you can not have a single website running in multiple application pools.
2) What is Private Memory of Application Pool?
Private Memory restricts web applications to consume more memory than the assigned limit. Default application pools have private memory of 0 KB, which means there is no limit. According to your server resources, you can run as many websites as you wish under the default application pool.
In case of dedicated application pool, certain amount of private memory is assigned. For example, If you allocate 250 MB of memory to a website, it cannot use personal memory more than 250 MB. If this application attempts to occupy more than 250 MB RAM, application pool will get automatically recycled. Additionally, website with 250 MB private memory only takes 100 MB while running, its 150 MB memory can be utilized to serve other websites.
3) What is Shared Application Pool?
An Application pool is denoted as Shared if there are several web applications/websites running under the same application pool.
The primary reason to combine websites into application pools was to conserve server memory. As we discussed earlier, each application pool is an instance of W3WP.EXE worker process for a single website or number of websites.
If you set a single application pool to 20 websites, for all of them only one W3WP.EXE process will be created. On a contrary, if all 20 website have separate application pools, 20 W3WP.EXE processes are completed. Hence, there's a large memory overhead to run a number of w3wp.exe processes.
By running several websites on shared application, you can conserve significant amount of RAM and other resources as well.
Shared application pool has significant benefit of sharing the server resources. Therefore, If you have no specific reason for splitting them up, it's better to keep them together.
4) What is Dedicated Application Pool?
An application pool is said to be Dedicated if each web application has its own application pool.
In other words, each website is isolated with other websites having a separate application pool. Isolating websites over application pools allow more rigid security between the applications, as well as preventing one website from crashing if another one does. Dedicated application pools have following advantages over shared application pool:
- You can assign resource-intensive websites separate application pools so that the performance of other applications does not decrease.
- If an application in one application pool fails, applications in other application pools are not affected.
- By isolating applications, you reduce the chance that one application will access the resources of another application.
- You can have different application pool settings for different applications.
- You can run untrusted and third party applications in a very restrictive environment so they do not get un authorised access to other applications.
- The event when you need to recycle the Application Pool, you can do so for only one site without affecting the performance of the others.
- Each application pool will have has its own private memory along with its own processes. Therefore, it will consume more server resources especially memory.
5) What is the Best Practice? Should I create an Application Pool for each application OR share an Application Pool with numbers of applications?
It really depends on the number of websites, server resource, type of web application and website requirements. When several applications run inside the same application pool they have the same resource and same security level. Therefore, if one website starts having issues, it could cause frequent application pool recycles that could impact all other. To be in safe side, you can assign one application pool per website. Although, it's not necessary in all cases. Following are some of the things, you can consider:
- If your web application is important, assign separate application pool.
- If your web application is third-party application and you are uncertain about its code, definately separate application pool.
- If your application is resource-intensive and creating major resource Spikes, separate application pool.
6) How do I determine memory requirement of website?
At first place, you should have web server with enough resources. Now, give the application an above-average amount of memory and monitor it for a few days, under normal usage.
This will give you better estimate of the resource requirements of this application. Now, decrease the application memory gradually. Meanwhile, continue measuring the impact of the changes. Determine the lowest amount of memory at which your Website gives the Optimal performance. This specific memory amount is a memory requirement of your application.
7) How do I configure WebsitePanel to automatically assign a dedicated application pool when the website is being created?
Please follow our step by step guide here.
→ Looking to change application pool of your website? Please refer to change IIS application pool for more details.