Advertisment

Process Isolation in IIS6

author-image
PCQ Bureau
New Update

In this final part of the series on IIS6, we will take a look on a feature called Process Isolation. This feature allows you to create self-repairing Web applications that ensure reliability of the Web server and the sites and apps running on it.

Advertisment

Web Admin Service



The Web Administration Service or WAS is a new component of IIS6 that periodically monitors the health of every application running on the server. The health can be set by user-defined parameters. 

WAS maintains a list of running Web applications in IIS. It then periodically iterates through this list, and retrieves health configuration parameters from the metabase. Based on this information, it checks if the current application is healthy or not. If not, then based on the user-defined configuration, it performs action on that application. What these health parameters are and what actions can be taken, are discussed later.

Worker Processes



IIS6 lets the administrator create Application Pools that host applications within them. A default application pool always exists that runs applications not assigned to any pool. 

Advertisment

Each pool is serviced by a process called W3WP (World Wide Web Worker Process). Therefore for any pool created, a new W3WP.EXE process is spawned. The worker process is responsible for hosting the applications within itself. The WAS monitors each W3WP as detailed above. 

Health Parameters



When an application pool is created, different health parameters can be configured for it at the same time, or later. These parameters are then stored in the metabase and used by WAS to monitor the pool.

The parameters include: time for which the worker process has been running, amount of physical or virtual memory used by the pool, percentage of CPU power being consumed and number of requests the process has handled. 

Advertisment

Each parameter can be configured and actions such as pausing or recycling the process (that is, resurrecting a new process to handle new requests and kill the old one automatically) can be performed. You can also configure the pool to stop recycling, in case a specified number of recycling happens in a specified time period. 

For instance, you can configure a pool to recycle itself when it crosses, say 100 MB of virtual memory. Now suppose after doing this, a new request comes in. The following then takes place in the Web server:

  • IIS6 checks whether a worker process already exists for the application pool, to which the request has come. If it does, then the request is passed to the corresponding W3WP.EXE.
  • In case, there is no worker process already, a new W3WP.EXE is spawned and the request is then passed to it.
  • Now suppose that a specific Web request causes the application running in this process to misbehave. That is, the application could crash, or start consuming large amounts of memory or CPU power
  • WAS has a user defined application pinging time that defaults to 30 seconds. That is, WAS monitors the state of the

    application pool (W3WP.EXE) every 30 secs. 
  • When WAS looks at this process next time, it compares parameters of the running application with the health parameters that are defined for it. In this case, it would find that the administrator has asked the application to be recycled if virtual memory usage crosses 100 MB. WAS immediately spawns a new W3WP.EXE for the same pool. This means that at this time, there are two worker processes for the same application pool.
  • IIS6 now directs new requests for that application to the newly spawned worker process.
  • As soon as the requests that are pending for the old worker process are finished, the worker process is terminated. This entire process is known as recycling.
  • The administrator can even set that in case the process is getting recycled too many times in a period, say more than 10 times in an hour, there is something fundamentally wrong in the application itself. In this case the administrator can choose to terminate, not recycle, the pool and inform the administrator regarding this status.
Advertisment

Configure an App Pool



To create an application pool, first create a new folder in C:\InetPub\WWWRoot and then open up Internet Information Server Manager from Administrative Tools. 

Here, right-click the Application Pools node in the left pane, and select New Pool. Enter a name for the pool, such as MyTestPool. Next, right-click the newly created pool and select Properties from the dropdown.

This brings up the Configuration dialog box, where you can set the different parameters of the health of the pool. You can work with the different settings to see what they do.

Advertisment

Finally, to add an application to the pool, right-click the virtual directory or folder under the website you have, and select

Properties. Click Create to make it a Web application, if not already done. (In case the folder is an application, you will see Remove button and not Create).

Set the Application Pool to MyTestPool in the same dialog box to add the current application to the pool created. Now this application will inherit the health parameters you have set.

Better features



IIS6 has many features that increase security, reliability and scalability of Web server and the applications hosted within it. If you are looking for development and production application server, then Windows 2003 with IIS6 makes a good choice.

Vinod Unny is a Technology Consultant at Enterprise InfoTech

Advertisment