Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the process mode of IIS ASP.NET

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what is the process mode of IIS ASP.NET". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the process mode of IIS ASP.NET".

ASP.NET processing Model of process Mode of IIS ASP.NET

So far, we have understood that when a request for an ASP.NET file is sent to IIS, it is forwarded to aspnet_isapi.dll, which is the main entry point for ASP.NET-related processing. In fact, this extension obviously depends on the version of IIS on the system, so the processing model processes requests and generates loopbacks through orderly operation execution by the asp.net runtime, perhaps a little bit.

In IIS5.X, all asp.net-related requests are assigned to an external worker process called the aspnet_wp.exe.ISAPI extension through the ISAPI extension, which runs in the IIS process (inetinfo.exe), and passes control to the aspnet_wp.exe along with all information about the current incoming request. Communication between the two processes is established through named pipes (known as the IPC [internal process communication] mechanism. The ASP.NET worker process performs most of the tasks of the ISAPI extension. Note the nature of each WEB application and the communication with different virtual directories under IIS, which are executed in the context of the same process as the asp.net worker process. In order to read the context ASP.net of their respective execution, the concept of application domain is introduced, which is abbreviated as AppDomains. They can be thought of as a lightweight process. More will be described later.

If you run on IIS6 and the aspnet_wp.exe process is not used, choose a better process called w3wp.exe. At the same time, inetinfo.exe is no longer used to pass HTTP requests to ISAPI extensions, although it still serves requests from other protocols. Although IIS6 can run in compatibility mode and simulate previous behavior, there are many changes compared to the previous IIS5 processing model. Compared to earlier 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 to avoid spending too much on internal information processing. In the following paragraphs, we will conduct a more in-depth study.

IIS5.0 processing Model of process Mode of IIS ASP.NET

This is the default processing model on windows2000 and XP systems. As mentioned above, he has an IIS inetinfo.exe process that listens for incoming HTTP requests on TCP port 80 by default and pushes them into a queue for processing. If the request type is asp.net, processing is delegated to the asp.net isapi extension aspnet_isapi.dll. Exe. This takes turns communicating with the ASP.NET worker process through a named pipe, which eventually processes and passes the request to the asp.net HTTP runtime environment. Figure 2 describes this process in detail.

Chart 2:IIS5.0 processing model

Figure 2 shows an element that we haven't mentioned yet-the ASP.NET HTTP runtime environment. At present, he is not the subject of our article, and he will be analyzed in the following article. The HTTP runtime can be thought of as a black box, where all ASP.NET specified processing takes place, and all regulated code runplaces, from the HTTP runtime to httphandler's final processing of the request and generating loopbacks, are processed here. ASP.NET pipes or HTTP runtime pipes are also involved here.

One interesting thing about this model is that all requests, once processed by the ISAPI extension, are passed to the asp.net worker process. There is one and only one instance of each activity, with one exception, which will be discussed later. So the asp.net web application running on IIS is actually running 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 concept of APPDomain, which is essentially a regulated lightweight process that provides independent and secure boundaries. Each IIS virtual directory is executed in an APPDomain, and it will be automatically loaded into the worker process as long as the resource belongs to the application requested * times. Once the appdomain is loaded, in other words, the current request for all required assemblies to be loaded into appdomain- is 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 on multiple threads. However, a thread does not belong to an appdomain, it can process multiple requests for multiple different appdomians, but a thread belongs to an APPdomain at a given time.

For performance purposes, worker threads can be recycled according to some standards (configured through MACHINCE.CONFIG files). These criteria include process life cycle, number of requests and queues, idle time, and memory allocation. Once a critical value of one of these parameters is reached, the ISAPI extension generates a new worker process instance to process the request. In fact, the previous process instance was not closed, but it was terminated from the service waiting for the request.

IIS6.0 processing Model of process Mode of IIS ASP.NET

IIS6 is the default for WINDOWS2003 systems. He has several changes and improvements in the IIS5 processing model. One of the changes is the concept of application pools. On IIS5 series applications, that is, all appDomains- runs on the asp.net worker process. To achieve an excellent definition of security and features, the IIS6 processing model allows applications to run on different copies of the same worker process. Each application pool can contain multiple appdomains (running on a single worker process copy). In other words, the change is from running all programs by a single process to running each application pool by multiple processes. This model is also called work process isolation mode.

The exception is a big change compared to the previous model in terms of IIS listening for all incoming data. In IIS5, the IIS process, inetinfo.exe, listens on the specified TCP port. In IIS6, incoming requests are processed and queued at the core level to replace the user mode that previously invoked http.sys through the core driver; this approach has several advantages over the previous pattern called the kernel-level request queue.

Figure 3 IIS6 processing model

Figure 3 mainly consists of request processing. Once a request reaches the core-level device driver http.sys, it is sent to the appropriate application pool queue, each of which belongs to a specified application pool.

The worker process is responsible for loading the asp.net ISAPI extension, which in turn loads all the work delegated by CRL to the HTTP runtime.

Unlike the aspnet_wp.exe under IIS5, the W3WP.exe process is not specific to asp.net and can be used to handle any type of request. What kind of ISAPI module is loaded according to the type of service resource required.

Thank you for your reading, the above is the content of "what is the process mode of IIS ASP.NET". After the study of this article, I believe you have a deeper understanding of what the process mode of IIS ASP.NET is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report