IIS and ASP. net http runtime Pipeline

Source: Internet
Author: User

Recently, I am reading the artech WCFArticleI am very familiar with some of his articles on IIS and ASP. NET ISAPI. At the same time, I made a summary of IIS and ASP. NET HTTP runtime pipeline by referring to other materials.

After reviewing the process of IIS processing Asp.net resources, the following figures are roughly drawn to deepen understanding. For more details, see several articles by artech: http://www.cnblogs.com/artech/archive/2007/09/09/887528.html

IISProcessing of user requests?

When you access static IIS resources, IIS directly extracts the corresponding files and returns them as HTTP Response to the client.

When you access dynamic IIS resources, IIS Further transmits the request to the correspondingProcessingProgram,HandlerAfter the execution is complete, the final HTTP response is returned to the client through IIS.

As mentioned aboveHandlerIs throughISAPI extension.

IISHow do I map different resources to ISAPI?

IISMetadata database maintainsISAPI extension mappingIs responsible for copying different types of resources to the corresponding ISAPI extension.

ASP. NETWhat is the corresponding ISAPI?

For ASP. NET-based resources, the corresponding ISAPI isASP. net isapi,ThroughAspnet_isapi.dllBearer

Iis5.xProcess ASP. NET Resource

Note:

1) Only one aspnet_wp process can be run on the same host at a time, and each ASP. NET application corresponds to an application domain, that is to say, each application runs in the same worker process. Application Isolation is based on application domain rather than process.

2) Asp. net ISAPI is not only responsible for creating the aspnet_wp worker process, but also responsible for monitoring the process. If the performance of aspnet_wp is detected to a lower limit, Asp. net ISAPI is responsible for killing the process. When aspnet_wp is terminated, subsequent requests will cause ASP. net isapi to re-create a new aspnet_wp worker process.

3Because IIS and application are running in their respective processes, the communication between them must adopt a specific communication mechanism. Essentially, the Inetinfo process andWorker ProcessCommunication between different processes of the same machine (Local Interprocess CommunicationsIn terms of performance, they adopt a communication mechanism based on named pipe. Communication between ASP. net isapi and worker process is implemented through a set of pipe between them. ASP. net ISAPI uploads the request to the worker process asynchronously and obtains the response. However, the worker process is synchronized to ASP. net ISAPI to obtain some server-based variables.

IIS6Process ASP. NET Resource

Iis5.xDefects

1In terms of performance, IIS and application run in different processes. Although Named Pipe-based Asynchronous Communication is adopted between them, however, the impact of inter-process-based communication on performance cannot be fundamentally solved.

2) From the perspective of reliability, only one worker process can be run on one machine, and each application runs in the same process. Although application domain-based isolation can provide a certain degree of reliability, however, once the entire process crashes, all applications will be affected. Therefore, we sometimes need to provide process-based isolation.

IIS6Improvement

1) Based on the Reliability Improvement, IIS 6 introduces the application pool.

In the createWeb ApplicationWe specify an existing application pool for it. At runtime, an application corresponds to a worker process: w3wp.exe ., Multiple worker processes can be run on the same machine at the same time. Each application domain in each worker process corresponds to one application.

2In terms of performance, IIS 5.xlistens to requests through inetinfo.exe and distributes requestsWork Process. In other words, in IIS 5. X listens to and distributes requests in user mode. in IIS 6, the request is transplanted to the kernel mode, all of this is through a new component: HTTP. SYS.

ASP. net http runtime Pipeline

 

 

 

Related Article

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.