IIS 6.0 architecture

IIS 6.0 further extended the architecture of IIS, with the addition of a worker process isolation mode and the ability to run multiple application pools. In addition, the HTTP request portion of inetinfo.exe was moved into the kernel to further improve performance. IIS 6.0 also introduced recycling of worker processes, an XML metabase, and rapid fail protection.

Http.sys
Http.sys was the new HTTP listener for IIS 6.0. Prior to IIS 6.0, inetinfo.exe listened for HTTP requests as well as routed them to the appropriate handler. Beginning with IIS 6.0, the listener function was broken out of inetinfo.exe, which ran in user mode, and Http.sys became the listener, running in kernel mode.

Kernel Mode versus User Mode
Kernel mode and user mode are the two modes that a process can run in under Windows Server 2003. Kernel mode has full access to all hardware and system data, whereas user mode processes cannot access hardware directly and have only limited access to system data. In the Intel processor architecture, kernel mode runs in ring 0, while user mode runs in ring 3. By running Http.sys in kernel mode, the listener has access to the TCP/IP stack directly, and sits outside of the WWW service, unaffected by faulty code or crashes in applications.

By running in kernel mode, Http.sys enjoys a higher priority and can respond to HTTP requests faster than in previous versions of IIS. Http.sys not only improves IIS performance by its priority response, it also can queue requests while waiting for application responses, even if the application has stopped responding. Each application pool in IIS 6.0 has a kernel mode queue, and Http.sys routes requests to
the appropriate queue. This is why performance tuning includes separating intensive applications into individual application pools, allowing other, less intensive applications to benefit by not having to share the same queue. Queue size is configurable for each application pool.

Http.sys also caches requests and will serve requests from this kernel mode cache whenever possible. A cached response will eliminate all processing by IIS, as Http.sys will simply return the response from the cache and bypass any IIS functions for heavily requested material. This cache is memory cache and cannot be paged, thus maximizing RAM in a system is a simple way to increase IIS performance. Maximizing RAM also reduces paging of inetinfo.exe, which, running in user mode, can be paged to disk as needed. Too little RAM for an IIS system will dramatically slow performance.


Other Http.sys Functions
Http.sys also handles TCP/IP connections for HTTP requests and responses, including creating and breaking down the connection itself. Because Http.sys sits directly on top of the TCP/IP stack, it also handles connections and timeouts, as well as the limit for number of connections and bandwidth throttling. Logs are also handled by Http.sys.

Http.sys performs two important functions that improve performance in IIS 6.0. It caches requests in kernel mode, meaning requests for recently served content, both static and dynamic, can be served from kernel mode without needing to switch to user mode and the inetinfo.exe process.

Http.sys also queues requests until they can be serviced by the appropriate worker process. Each application pool has its own queue, and the size of the queue is configurable to tune performance of specific pools. This queuing also has an advantage for applications that might fail, since requests for a failed application are still queued to the limit of the queue size. These requests can be processed when the application begins responding again and, combined with the ability to auto-restart failed application pools, can keep applications responding with no more indication to the client than a slight delay.

Source of Information : Wrox Professional IIS 7

0 comments


Subscribe to Developer Techno ?
Enter your email address:

Delivered by FeedBurner