Sunday, March 1, 2009

IIS Worker Process and Application Pooling

Web server?
IIS (Internet Information Service) running on a software port like 80 for Http and 443 for Https or any other port set bt the administrator, it can host more than one web site and each web site can hold more than one web application. Web server provides application pooling and hanldes all web request from the internet and forward it to respective web site's application pool for processing and response. IIS can host classic asp applications, asp.net applications, php applications, etc.

Application Pooling?
The Windows IIS web server, has application pools where different web applications or web sites can be pooled. When we say pooled it means it is loaded in the process, so the web requests are processed. Why pooling? becuase the application will handle multiple web requests, the application is loaded once, and remains in the pool for quite some time to process subsequent requests and when remains idel for too long it is unloded. The pooling helps better manage server resources, so the CPU and Memory is not consumed uselessly. An application pool can hold more than one web application, and IIS can have more than one application pools. Application pools it self is comprehensive topic and it provides many things to tune your web application performace.

Worker Process?
As we discussed above, application pooling is done in IIS, Worker Process is actually a program that executes in the system memory for a specific application pool, if we have three application pools and the pools are active than we will have three process running it the system memory, these are the processes which handle the requests and send response. The "w3wp.exe" program can be easily found in the task manager, this is the program running behind the application pool.
We can define more than one worker process in an application pool, by default we have one worker process in an application pool, this means there is only one queue for my web requests, so ten request will execute one at a time.
If i increase the number to 2, so now my application pool has 2 worker process, this means there are two queues for my web requests, so ten request will execute two at a time. Ofcourse the CPU time will be divied between the two worker processes, this means to many worker processes will cut down the overall response time if i have a moderate server, therefore it depends upon the hardware of the server that how many worker processes it can hold.

No comments:

Post a Comment