Analysis of iis asp. NET process mode

Source: Internet
Author: User

What are the process modes of iis asp. NET? What are their respective characteristics? To start our explanation.

ASP. NET Processing Model for iis asp. NET process mode

So far, we have understood that when an ASP. NET file request is sent to IIS, it is transferred to aspnet_isapi.dll, which is the main entry point for ASP. NET processing. In fact, this extension is obviously dependent on the IIS version on the system. Therefore, the processing model processes the request and generates a send-back request through the sequential operation when asp.net is running, which may change a little.

. Communication between two processes is established through the named pipeline (we all know that IPC [internal process communication] mechanism. ASP. NET workers execute most tasks of ISAPI extension. Note the essence of each WEB application and the communication with different virtual directories in IIS. They are executed in the context of the same process of asp.net. In order to read the context ASP.net introduced the concept of application domains in their respective executions, AppDomains can be considered as a lightweight process. More information will be introduced later.

Callback is no longer used to transmit HTTP requests to ISAPI extensions, although it still serves requests of other protocols. Although IIS6 can run in compatible mode and simulate previous behavior, there are many changes compared to the previous IIS5 processing model. During the most recent changes, when the processing model runs on IIS5, incoming requests are passed in the form of lower-kernel-level and then passed to the correct ISAPI extension, this avoids excessive operations on internal information processing. In the following section, we will conduct more in-depth research.

IIS5.0 Processing Model for iis asp. NET process mode

This is the default processing model on Windows and Windows XP systems. As mentioned above, the IIS inetinfo.exe process listens to incoming HTTP requests on TCP port 80 by default and pushes them to the queue for processing. If the request type is asp.net, the processing will be delegated to asp.net isapi extension aspnet_isapi.dll. in this way, the named pipeline and ASP are used in turn. NET Worker Process Communication, and finally the Worker Process and pass the request to the asp.net HTTP runtime environment. Chart 2 describes the process.

Figure 2: IIS5.0 Processing Model

 

Figure 2 shows an element we have not mentioned-ASP. net http runtime environment. Currently, he is not the topic of this article. He will be resolved in the following article. HTTP runtime can be regarded as a black box, all ASP.. NET specifies that processing occurs here. All the controlled code runtime sites, from HTTP runtime till httphandler finally processes the request and generates a response, are processed here. This also involves ASP. NET pipelines or HTTP runtime pipelines.

One interesting thing about this model is that all requests are passed to the asp.net workflow once extended by ISAPI. Each activity has only one instance and one exception, which will be discussed later. Therefore, the asp.net web application running on IIS actually runs on the worker process. However, this does not mean that all applications run in the same context and share all their data. It is worth mentioning that asp.net introduces the APPDomain concept, which is essentially a lightweight process that provides independent and secure boundaries. Each IIS virtual directory is executed in an APPDomain and will be automatically loaded to the worker process as long as the resource is the application of the first request. Once the appdomain is loaded, in other words, all the required assembly of the current request is loaded to the appdomain-actually passed to the asp.net pipeline for processing. Several appdomains can run in the same process in this way, when multiple requests for the same appdomain can come out in multiple threads. Even so, a thread does not belong to one appdomain. It can process multiple requests for multiple different appdomians, but a thread belongs to one APPdomain at the same time.

For performance purposes, the worker thread can be recycled according to some standards (configured through the MACHINCE. CONFIG file. These standards include process lifecycle, number of requests and queues, idle time, and memory allocation. Once the critical value of these parameters is reached, the ISAPI extension will generate a new worker process instance to process the request. In fact, the previous process instance is not closed, but it is the request to terminate the service.

IIS6.0 Processing Model for iis asp. NET process mode

IIS6 is the default in WINDOWS2003. There are several changes and improvements to the IIS5 processing model. One of the biggest changes is the application pool concept. In the IIS5 series of applications, that is, all appDomains-run on the asp.net workflow. To better define security and features, the IIS6 processing model allows applications to run on different copies of the same workflow. Each application pool can contain multiple appdomains (running on a single worker copy ). in other words, this change is from a single process running all programs to multiple processes running every application pool. This model is also called the work process Isolation Mode.

The exception is a big change compared to the previous model in terms of IIS listening for all incoming data. Inetinfo.exe listens to the specified TCP port in iis5. In IIS6, incoming requests are processed and the queue replaces the previous http call with the core driver at the core level. sys user mode; this method has several advantages over the previous mode called the kernel-level Request queue.

Figure 3 IIS6 Processing Model

 

Figure 3 consists of request processing. Once a request arrives at the core-level device driver http. sys, it is sent to the corresponding application pool queue. Each queue belongs to a specified application pool.

Worker processes are responsible for loading asp.net ISAPI extensions, and loading CRL in turn to delegate all work to HTTP runtime.

The process of w3wp.exeis different from the aspnet_wp.exe in iis5. it is not unique to asp.net and can be used to process any type of requests. The type of ISAPI module to be loaded depends on the type of the required service resource.

The process mode of iis asp. NET will be introduced to you here, hoping to help you.

  1. Analysis on Static Page implementation using ASP. NET
  2. Analysis of ASP. NET connection string Traversal
  3. Analysis on the types and features of ASP. NET Cache
  4. Three methods of ASP. NET page Jump
  5. Analysis on the nature and connection of iis asp. NET

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.