HTTP. sys explanation

Source: Internet
Author: User

HTTP. sys is located in win2003 and WINXP SP2Core Components of the Operating System,

Allows any application to communicate with each other over HTTP through the interfaces it provides.
Tip: If you accidentally delete the driver file, you don't have to worry about it. The driver will be rebuilt the next time the system starts. Is a core component of the system that cannot be deleted! After the utility ends the driver, the driver will be re-created immediately (only the files to be crushed cannot be re-created immediately, but after the driver is crushed, it will be re-created next time ).
Microsoft introduced a new http api and Kernel Mode Driver HTTP. sys in Windows 2003 Server to make HTTP service-based programs more efficient. The direct beneficiaries of this change are IIS 6.0 and Asp.net.
In fact, after Windows XP installs SP2, HTTP. sys has already appeared in the system, but in fact, the operating system does not actually use this kernel-level driver, and IIS 5.1 on XP does not use HTTP APIs.
The core changes in the new http api are encapsulated in the kernel mode driver of HTTP. sys. Previously, HTTP-based programs run in user mode, and must handle software interruptions, context switches, thread scheduling, and other issues by themselves, and are often unable to freely access system resources. In the past, HTTP servers, such as IIS and Apache, used Winsock APIs to create a network listener in user mode. The Network listener (I. e.: per application or per Thread basis) occupies an IP port. In layman's terms, only one application can listen to one port at a time, which is sometimes an uncomfortable restriction.
The new HTTP. sys offers the following benefits:
1. cache-static content is now cached in kernel mode, which enables Faster service response
2. Log-IIS's log function is faster and standardized
3. bandwidth control-greater scalability control and throttling
4. reliability-all service requests are sent over HTTP. in sys, it is saved into the queue rather than processed by the service program itself. In this way, even if the service program is restarted, the unprocessed requests will not be lost.
5. IP port reuse-now, as long as it is through HTTP. the ports managed by sys (including the famous ports such as 80) can be monitored by multiple programs at the same time.

 

HTTP. sys is a new listener used by IIS 6.0. Before IIS reaches, inetinfo.exe can listen for HTTP requests and forward the requests to the corresponding processing program. Starting from IIS 6.0, the reader and inetinfo.exeare separated, inetinfo.exe runs in user mode, HTTP. sys completes the HTTP request listening function, and runs in kernel mode.

1. kernel mode and user mode

In Windows Server 2003, a process can run either in kernel mode or in user mode. If a process runs in kernel mode, the process can access all hardware and system data. If a process runs in user mode, the process cannot directly access the hardware, in addition, access to system data is restricted. In intel processor architecture, kernel mode runs within Ring 0, and user mode runs on Ring 3. Run HTTP in kernel mode. sys, the listener can directly access the TCP/IP protocol stack, but can be located outside the WWW Service, so that it will not be affected by code defects in the application, and the application will not crash.

By running in kernel mode, HTTP. sys has a higher priority. Compared with earlier versions of IIS, HTTP request response is faster. HTTP. sys not only improves IIS performance because of its high priority, but also queues requests while waiting for the application to respond (even if the application has stopped responding. In IIS 6.0, each application pool has a kernel-mode queue. http. sys can forward requests to suitable queues. Therefore, in IIS 6.0, when we optimize performance, we can separate applications with heavy loads into different application pools, therefore, applications with lighter load ratios do not need to share the same queue with applications with heavier loads. The queue size is configurable for each application pool.

HTTP. sys can cache requests and complete the requested service in kernel mode as much as possible. If the response to a request has been cached, IIS does not need to re-process the request. sys only needs to extract the response from the cache, so that all IIS functions are bypassed, thus avoiding re-processing. These cached requests are stored in the memory and cannot be swapped out. Therefore, increasing the system memory as much as possible is a simple and effective way to improve IIS performance.

The system memory can be increased as much as possible and the number of disk exchanges with inetinfo.exe can be reached. Inetinfo.exe runs in user mode and can be switched to disk space when necessary. If the system memory is too small, the IIS performance will drop sharply.

2. Other HTTP. sys Functions

For HTTP requests and responses, HTTP. sys can also process TCP/IP connections, including creating connections and disconnecting them. Because HTTP. sys runs directly on the TCP/IP protocol stack, you also need to handle connections and timeouts, as well as connection restrictions and bandwidth insufficiency. In addition, HTTP. sys also needs to process logs.

HTTP. sys improves the performance of IIS 6.0 by executing two important functions. First, HTTP. sys caches requests in kernel mode. Therefore, in order to provide services for a request, if the content required by the request has recently been running in the prepare process of a previous request.

HTTP. sys can also queue requests to complete the requested services by appropriate working processes. Each application pool has its own queue, and the queue size can be configured. In this way, we can optimize the performance of a specific application pool. For applications that may be invalidated, another advantage of using the queue is that requests for expired applications will still be stored in the queue, until the total number of requests saved in the queue reaches the upper limit of the queue. When the application can respond again, these requests can still be processed. In addition, the response time can be reduced by automatically restarting the invalid application pool, the response of the application is only a little delayed.

HTTP. sys explanation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.