Asp. NET worker threads vs. request queues

Source: Internet
Author: User

When ASP. NET receives a request for a page, it extracts a thread from the thread pool and assigns the request to that thread.

A normal (or synchronized) page retains the thread during the request, preventing the thread from being used to process other requests. If a synchronization request becomes an I/O bound (for example, if it calls a remote Web service or queries a remote database and waits for a call to return), the thread assigned to the request is pending before the call returns. This affects scalability because the thread pool's available threads are limited.

The setting of this number is the maxWorkerThreads property of the following node in the Machine.config

<system.web>
<processmodel requestqueuelimit= "num| Infinite "maxworkerthreads=" num "/>
System.web>maxworkerthreads The maximum number of worker threads that are configured for a process by CPU. For example, if the value on a single-processor server is 25,asp.net, use the run-time API to set the process limit to 25. On a dual-processor server, the limit is set to 50. The value of this property must be equal to or greater than the minFreeThread property setting in the HttpRuntime configuration section. The range of this property is from 5 to 100.  ASP. NET request queue The above settings also have a queue setting, as follows: requestQueueLimit Specifies the number of requests allowed in the queue, after which ASP. NET will start returning the "503-Server Too busy" message to the new request. By default, this number of available sub-threads is 1000. Set the place for this parameter in IIS6 and IIS7. The number of threads available for IIS 7 sets the number of threads available for IIS 6 if all the request processing threads are blocked to wait for the I/O operation to complete, other requests are queued for the thread to be freed. In the best case, throughput is reduced because the request waits longer to be processed. The worst case scenario is that the queue fills up, and ASP. 503 "Server Unavailable" error causes subsequent requests to fail.

Asp. NET worker threads vs. request queues

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.