One worker process can serve only one application pool. Application pool can contain more than one web applications. You can't serve the application pool with two different version of worker process. However, you can add multiple worker processes of same version in application pool. Here version of worker process means asp.net runtime version like 2.0 or 4.0.
In IIS 6.0 you can assign 4000000 worker process to server your Application Pool.
To know how many worker processes are presently serving your application pool, you can open command prompt and
Execute command IISapp.Vbs
It will tell information about W3Wp process and its process ID.
C:\Documents and Settings\Administrator>iisapp
W3WP.exe PID: 30736 AppPoolId: ReportServer
W3WP.exe PID: 12348 AppPoolId: ReportServer
Note*: If you are using In proc session storage mechanism and you are adding multiple worker process to your application pool,
You will definitely loose session values. To avoid this use SQL server or state server for storing session state.
This way session values will get shared across all worker process.
By default when you deploy your web application on IIS, it assigns default application pool which has only one worker process.
As shown in Fig.1. above. You can see virtual directory samsung, motorola and nokia
are mounted on Application pool #1 and all requests coming to those websites are
served by default worker process 1. In this scenario if worker process 1 becomes
unhealthy, the entire website of application pool #1 goes offline or down.
Add multiple worker process to your application pool and see magical performance boost in your web application.
As you can see in Fig.2. The Application Pool #1 has virtual directory named samsung
and it is served by worker process 1 and 2.
Also, Application pool #2 has virtual directory called motorola and it is served by
worker process 3 and 4.
In this scenario if worker process of application pool #2 becomes unhealthy the website http://mysite.com/samsung will not go down or offline and vice versa.
Even you can add multiple website in either Application pool #1 or #2.
Note: In web gardening scenario you must store the session out of process using
SQL serer or state server otherwise you will loose the session values during subsequent
There are two types of process model in Asp.net. The one is Proacive and other is Reactive recycling.
You need to find out wheter to proactively recycle the process or let it be reactive.
In proactive process recycling, you can let the process recycle after getting predefined number of requests to
your web application. It will prevent your system from getting crashed. During recycling of the process
system generates new instances of worker process to serve the new incoming requests and old requests which are in
queue or process get served by old worker processes. As soon as old requests ends the system kills the old instances
of worker processes.