Asp. NET operating mode and principle under IIS

Source: Internet
Author: User

Asp. NET and IIS are closely linked, because the IIS6.0 and IIS7.0 work in different ways, resulting in the asp.net work principle has also undergone a corresponding change.

IIS6 (IIS7 Classic mode) differs from IIS7 integration mode

IIS6 Running Process:

The analysis above shows that:

Under User mode, HTTP.sys receives the HTTP request, and then it looks at the application Pool that is based on the request's application, based on the Metabase in IIS, if the APPL Ication Pool does not exist, it is created. Otherwise, the request will be sent directly to the queue corresponding to application Pool. Each application Pool corresponds to a Worker process-w3wp.exe (running under User mode).

The mapping of application Pool and Worker Process is maintained in IIS Metabase. Was (Web administrative Service), based on such a mapping, passes a request that exists in a application Pool Queue to the corresponding Worker Process (if not, create such a Process). When the Worker Process is initialized, load the asp.net isapi,asp.net ISAPI and then load the CLR. Finally, a application Domain is created for application by the Appmanagerappdomainfactory create method, and ProcessRequest is processed through Isapiruntime requ EST, which then enters the process into the ASP.net Http Runtime Pipeline.

Several knowledge points:

HTTP. SYS: (Kernel) A component that listens for (Listen) an external HTTP request and forwards it to the appropriate application pool (application pool) according to the requested URL. When this HTTP request is processed, it is also responsible for sending the processing results. In order to provide better performance, a buffer was built inside the http.sys to save the most recent HTTP request processing results.

Application Pool:iis always maintains a separate worker process: the application pool. All processing occurs in this process, including the execution of the ISAPI DLL. For IIS6, application pooling is a significant improvement because they allow for a smaller granularity of control over the execution of a specified process. You can configure the application pool for each virtual directory or the entire Web site, which makes it easy to isolate each application into its own process so that it can be completely isolated from other programs running on the same machine. From the Web processing point of view, if a process dies, at least it does not affect other processes.
When an application pool receives an HTTP request, the worker process worker Process:w3wp.exe that is running in this application pool handles this HTTP request.

Worker process: When a worker processes receives a request, it first finds and loads the corresponding ISAPI extension based on the suffix (for example, the ASPX mapping is Aspnet_isapi.dll), and the worker process finishes loading the aspnet_ After Isapi.dll, the aspnet_isapi.dll is responsible for loading the ASP. NET application is the CLR (. NET Runtime).
The Worker process runs in an unmanaged environment, while objects in. NET run on top of the managed Environment (the CLR), and the bridge between them is the ISAPI extension.

Was (Web Admin Service): This is a monitoring program that can access the various information placed in the Inetinfo metabase (Metabase) and monitor the application pool on the other hand (application Pool) The working state of the worker process, if necessary, it closes an old worker process and creates a new one instead.

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.