Application Pools in IIS 6
Question.) I will soon install a small Ajax Asp.Net "single page" site on a client site. This page is simply polling a Asp.Net Web service, which fetches and returns parameters (temperature, air conditioning status...) to be displayed on the page. This is implemented with an Ajax Timer control server.
1.) Now this is my first "industrial" web site, and I'm concerned about its robustness. Do I need to create a specific pool on IIS 6 for the web service and the site ?
2.) I'm aware than it is possible to "recycle" a pool. Do I need this ?
Just to give you a background, the user is using Windows Server 2003 Standard Edition running IIS 6 and has all the required dependencies installed properly (ASP, .Net). Next, lets grab some base level knowledge on Application Pools before we hit on the answers.
To begin with, an Application Pool is a concept that was introduced in IIS 6. The major reason for this was Application Isolation and in a short while you will understand how.
The 2 modes that IIS operates in are the IIS 5 Isolation mode, where in, IIS 6 acts similar to IIS 5 architecture. Therefore, you cannot make use of AppPools or it's concept in this mode. Whereas , when you run IIS 6 in the Worker Process Isolation Mode (WPIM) you can combine/separate web applications or web sites into groups called Application Pools. Application Pools are nothing but the URL collection of the web application or web site that will now run under one or several worker process (W3WP.exe).
A quick point: While an Application Pool is serving a request, the same request cannot be routed to another Application Pool. However, subsequent request can go to a new AppPool (if defined).Every application within an application pool shares the same worker process. Therefore, applications that run in 2 different AppPools cannot share or effect each other.
What is the use?? OK...Here comes our
Answer 1.) IIS 6 provides very effective method of process isolation by separating web applications based on w3wp.exe (worker process executable). Hence, an AppPool that may have a dirty code will not effect the website in an adverse manner. Your application pool running a good code will still be up and running as ever.
If you are an IIS admin or a developer who has fair bit of knowledge on IIS will surely understand how important this development is.
Having understood that. let us know try and figure out how the request processing is happening. Now, we all know that the request initially comes to the IIS kernel mode driver HTTP.sys. Further, within HTTP.sys an application pool is represented by a request queue, from which the user-mode worker processes that service an application pool collect the requests.
Knowing this we can move on to our next concept called, Application Pool Recycle. Every now and then when your application goes bad or the application pool crosses a defined set of parameters for an Application Pool property, the w3wp.exe concerning the AppPool will be shutdown (Killed) and a new w3wp.exe will automatically be created in it's. This provides you to have your Application Pool in good health, always. For the sake, of the blog's length I will not go into those parameters and properties but if you wanna know then drop in a comment and I will get back to you. Application Recycling is very important but then it depends on what parameters
and properties of an AppPool you would like to have it recycled. Done with Answer 2 :)
I think I might come up with a few blogs in near future on IIS. Stay Tuned!! :D