IIS 7.0 Architecture Tutorial
IIS 7.0 includes several core components that work together to process client HTTP requests. Each component has different responsibilities in the request processing, such as listening for requests made to the server, activating and managing processes, and executing requests.
IIS 7.0 Core Components
- HTTP protocol stack (HTTP.sys) HTTP.sys is the kernel mode protocol listener that listens for HTTP and HTTPS requests.
- World Wide Web Service Publishing Service (W3SVC) W3SVC is an HTTP listener adapter. It owns communication with HTTP.sys and Windows Process Activation Service and provides configuration information to HTTP.sys.
- Windows Process Activation Service (WAS, also known as WPAS) WAS provides management of worker processes. It starts, stops, and recycles application pools and monitors the health of worker processes at run time. In addition, it obtains configuration information from the configuration store.
- Configuration store Configuration store is a distributed XML-based file hierarchy that stores both IIS and ASP.NET settings. IIS server-wide configuration information is containedin the IIS global configuration file applicationHost.config located on the top of the hierarchy. The global.NET Framework configuration files, machine.config and root web.config, are also located on the top of the hierarchy.
- Worker process w3wp.exe W3wp.exe is a long-running process that processes requests and generates responses. The requests are executed within a worker process. Multiple worker processes can run concurrently. A worker process can execute requests in one of two ways: in .NET Integrated mode by using IIS and the ASP.NET integrated request processing pipeline, or in Classic mode where IIS and ASP.NET requests processing is not integrated, as in IIS 6.0.
IIS 7.0 core components perform key functions in the processing of an HTTP request. When an HTTP request arrives at the server from the client, the path in the request URL is parsed to determine which site and application the request is for. Each application runs within an application pool. One or more worker processes serve an application pool.
When IIS 7.0 receives a request for an application, IIS maps the request to a worker process for an application pool the application belongs to. If this is the first request for the application pool, the worker process is started, and the server functionality is loaded into the process. Then, the request is passed to the worker process. The worker process executes the request, and the resulting HTTP response is returned to the client.
In IIS 7.0, HTTP request processing consists of the following steps
An HTTP request from a client browser arrives to the server. HTTP.sys intercepts the request.
HTTP.sys checks if it has the configuration information for an application the request is sent to.
- If HTTP.sys has the configuration information, it forwards the request to an appropriate worker process.
- If HTTP.sys doesn't have the configuration information, it contacts W3SVC, which passes the request for information to WAS.
- WAS obtains configuration information from the IIS global configuration file, applicationHost.config.
- WAS checks the worker process in the application pool to which the request is made. If there is no worker process, WAS starts a worker process for that application pool.
- WAS passes configuration, including as application pool and application configuration settings, to W3SVC.
- W3SVC uses configuration received from WAS to configure and update HTTP.sys.
- HTTP.sys forwards the request to the worker process.
- The worker process begins a request processing pipeline to execute the request. A request processing pipeline is an ordered list consisting of components that perform specific tasks to process a request. At the end of this processing, a response is generated and returned to HTTP.sys. We will discuss the request processing pipeline in the section titled "Request Processing in Application Pool" later in this chapter.
- HTTP.sys sends a response to the client.