IIS 5.0 and 6.0 thread distribution
The request on IIS5.0 is a typical response based on I / O thread, or thread asynchronous implementation I / O because use asynchronous write naming pipes to assign these requests to work processes. When a request is in response to a request, it will use the asynchronous read thread. Threads in the working process are used to respond to the request from the CLR thread pool of the process range. Although the thread of the thread pool is incorrect by the binding I / O implement port is incorrect (ISTHREADPOOLTHREAD OF THREAD), but do not expect to use this attribute.
Although the service in the IIS5.0 response request is based on an I / O thread, some requests will be terminated to normalize the working thread from the pool, so the two threads are simultaneously excited. The default CLR thread pool size is 25, separated by I / O threads and working threads. There is a maximum of the upper limit of the thread pool, as mentioned earlier.
There is a huge change in IIS6 (2003). First, inetifo.exe is no longer used to respond to HTTP requests. As a substituted, HTTP request is placed in an internal mode, and http.sys is used to distribute each suitable application queue. In addition, IIS6 supports the application pool, can share a single working process, now named w3pwp.exe. The application pool gives you in many different working processes, depending on your extent to which you are separating your web application.
This example changes the processing method of the ASP.NET response request. Using distribution requests from inetinfo.exe to the ASP.NET work process, http.sys queues every request in the appropriate process. All requests now have a working process from the CLR thread pool to respond, no longer use I / O threads. The description of the Machine.config discovery on 2003, the process mode is still initializing the upper limit of the thread pool, however, all of the properties are ignored, and they are now stored on the metadata of IIS6. Asynchronous requirements
Many factors affect the extensibility of the web application. Usually, in any case, multiple concurrent operations request to access shared resources, the system's scalability will be damaged, and the above system shared resource list is the CPU itself (or the CPU set located in multiple processing boxes). The server running ASP.NET has its own CPU, which shares concurrent requests depending on the way pool. Such a thread pool purpose is the maximum number of thread pools in the thread pool for the time of assigning the CPU processing request. This is an important constraint for some places, as there is a lot of concurrent requests, creating the number of unordered threads can be easily stopped.
However, if the thread located in the thread pool is used to perform non-CPU-INTENSIVE work (such as a request or calling a remote web service for remote data), this will affect the thread pool without having a high CPU utilization. In this case, in fact, the thread pool reduces the system's scalability, because the request will be delayed (or may be rejected) Even if the server is not busy with other requests.
For example, an example of a swamp thread pool, the next ASP.NET page, Slow.aspx, its artificial delay service response time two seconds and prints out threads, just as:
<% @ Page language = "c #"%>
<% @ Import namespace = "system.reflection"%>
<% @ Import namespace = "system.threading"%>
Protected Void Page_Load (Object SRC, Eventargs E) {
System.Threading.Thread.Sleep (2000);
Response.Output.write ("SlowResponse, threadid = {0}",
Appdomain.getCurrentThreadId ());
}
script>
another
ASP.NET
page
Fast.aspx,
compared to
Slow.aspx
Convinced
,
In addition to not resting for two seconds, it is the same
:
<% @ Page language = "c #"%>
<% @ Import namespace = "system.reflection"%>
Protected Void Page_Load (Object SRC, Eventargs E)
{
Response.Output.write ("FastResponse, ThreadId = {0}",
Appdomain.getCurrentThreadId ());
}
script>
Use the web to apply the pressure tool to detect these two pages, you can find the average response time of the test in a large number of requests. The initial average response time for the Fast.aspx page is 0.0824 seconds, responding within 1 minute, 52,190 A request. At the same time, Fast.aspx and Slow.aspx, Fast.aspx time are 4.47 seconds, and SLOW.ASPX is 6.54 seconds, the total number of requests is reduced to 1062 times in 1 minute.