IIS is the most popular ASP.Net web server provided by Micrsoft.
Worker Process: All asp.net application runs under the scope of Worker Process (w3wp.exe), which act as application boundary. When a request comes to the server from a client worker process is responsible to generate the request and response.
Application Pool is the container of worker process. An app pool can have multiple worker process that share same configuration, by default there is only one worker process per app pool. A server can have multiple App pool for different application.
eg: an enterprise organization might place its human resources Web site and its finance Web site on the same server, but in different application pools.
Application Pool with multiple Worker process is “Web Garden“.
Now the request handling by IIS is divided into two stages:
1) In Kernal level, the request received by IIS is handled by HTTP.SYS, which identify the App pool to process the request.
2) In User Level, we have Web Admin Services (WAS) which takes the request from HTTP.SYS and pass it to App pool.
3) When App pool rceive the request it simply passes the request to the worker process (w3wp.exe) which looks up the URL of request to load the correct ISAPI extension.
ISAPI extensions are the IIS way to handle requests for different resources. Once ASP.NET is installed, it installs its own ISAPI extension (aspnet_isapi.dll) and adds the mapping into IIS.
4) When wp loads the aspnet_iisapi.dll, it starts the HttpRuntime, which is the entry point of your application.
5) HttpRuntime calls the ProcessRequest method to start processing
It creates the instance of HttpContext which provide access to all it’s properties like Request, Response, Session using HttpContext.Current properties.
6) Then HttpRuntime loads HttpApplication object