ASP.NET IIS - 当请求排队? [英] ASP.NET IIS - when are requests queued?

查看:253
本文介绍了ASP.NET IIS - 当请求排队?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的<一个href=\"http://blogs.msdn.com/b/tmarq/archive/2007/07/21/asp-net-thread-usage-on-iis-7-0-and-6-0.aspx\">following文章由托马斯·马夸特介绍了IIS如何处理请求ASP.Net可以配置为运行,最大/最小CLR工作线程/管理的IO线程,所涉及的各种请求队列及其默认大小。

The following article by Thomas Marquardt describes how IIS handles ASP.Net requests, the max/min CLR worker threads/Managed IO threads that can be configured to run, the various requests queues involved and their default sizes.

现在按照文章,下面在IIS 6.0中出现:

Now as per the article, the following occurs in IIS 6.0:


  1. ASP.NET拿起从IIS IO线程和岗位HSE_STATUS_PENDING到IIS IO线程的要求

  2. 的请求移交给一个CLR工作线程

  3. 如果该请求是高延迟的,所有的线程被占用(线程数接近httpRuntime.minFreeThreads),然后将请求发布到应用级请求队列(此队列为每个AppDomain)

  4. <击> ASP.NET还检查并发执行的请求数。该文章指出,如果并发执行的请求数太高它会将传入的请求到ASP.NET全局请求队列(这是每个工作进程)(请检查更新2)

  1. ASP.NET picks up the requests from a IIS IO Thread and posts "HSE_STATUS_PENDING" to IIS IO Thread
  2. The requests is handed over to a CLR Worker thread
  3. If the requests are of high latency and all the threads are occupied (the thread count approaches httpRuntime.minFreeThreads), then the requests are posted to the Application level request queue (this queue is per AppDomain)
  4. Also ASP.NET checks the number of concurrently executing requests. The article states that "if the number of concurrently executing requests is too high" it queues the incoming requests to a ASP.NET global request queue (this is per Worker Process) (Please check Update 2)

我想知道什么是阈值在这一点上ASP.NET认为请求数当前执行得太高,然后开始排队的请求到全球ASP.NET请求队列?

I want to know what is the "threshold value" at which point ASP.NET considers that the number of requests currently executing it too high and then starts queuing the requests to the global ASP.NET request queue?

我认为该阈值将取决于工作线程最大数量的结构,但也有可能是基于一些式在其上ASP.NET将确定同时执行的请求的数量过高,并开始排队的请求到ASP.NET全局请求队列。可能是什么这个公式?或者是这个设定配置的?

I think this threshold will depend upon the configuration of max number of worker threads, but there might be some formula based on which ASP.NET will determine that the number of concurrently executing requests is too high and starts queuing the requests to the ASP.NET global request queue. What might this formula? or is this setting configurable?



更新
结果
我通过阅读文章再次在评论部分,我发现这一点:


Update
I read through the article again and in the comments sections I found this:

1)在IIS 6和IIS 7经典模式,每个应用程序(应用程序域)
  有,它用来维护劳动者的可用性队列
  线程。请求在此队列数量的增加,如果数字
  可用的工作线程低于由指定的限制
  的httpRuntime minFreeThreads。当限制由指定的
  的httpRuntime超过AP prequestQueueLimit,请求是
  与503状态code拒绝,客户端收到
  HttpException消息服务器太忙。还有一个
  ASP.NET性能计数器,请求在应用程序队列,即
  显示多少个请求队列中。是的,CLR线程
  池是一个由.NET ThreadPool类暴露出来。

1) On IIS 6 and in IIS 7 classic mode, each application (AppDomain) has a queue that it uses to maintain the availability of worker threads. The number of requests in this queue increases if the number of available worker threads falls below the limit specified by httpRuntime minFreeThreads. When the limit specified by httpRuntime appRequestQueueLimit is exceeded, the request is rejected with a 503 status code and the client receives an HttpException with the message "Server too busy." There is also an ASP.NET performance counter, "Requests In Application Queue", that indicates how many requests are in the queue. Yes, the CLR thread pool is the one exposed by the .NET ThreadPool class.

2)requestQueueLimit甚少命名。这实际上限制了
  可以通过ASP.NET提供服务的最大请求数
  兼任。这包括排队请求和
  正在执行的请求。如果请求当前性能
  计数器超过requestQueueLimit,新传入的请求会
  与503状态code拒绝。

2) The requestQueueLimit is poorly named. It actually limits the maximum number of requests that can be serviced by ASP.NET concurrently. This includes both requests that are queued and requests that are executing. If the "Requests Current" performance counter exceeds requestQueueLimit, new incoming requests will be rejected with a 503 status code.

<击>
所以基本上requestQueueLimit限制了排队(我假设它将总结在应用队列排队的请求外加全局ASP.Net请求队列的数目加上请求当前正在执行的数目)和正在执行的请求的数量。所有虽然这并没有回答原来的问题,但它确实提供了有关我们可能会收到,因为大量的并发请求数/高延迟请求的503服务器忙的错误信息。
(检查更新2)

更新2
有在我的理解犯的一个错误。我已经混了描述为IIS 6和IIS 7结果
本质上讲,当ASP.NET在IIS 7.5和7.0在集成模式下托管,应用程序级队列不再present,ASP.NET维护一个全局请求队列。
结果
因此,IIS 7 / 7.5将开始执行,如果请求的数量被认为是高排队请求到全局请求队列。这个问题更适用于IIS 7 / 7.5,而不是6。
搜索结果
IIS 6.0 而言,没有全局ASP.NET请求队列,但符合下列条件:结果
1. ASP.NET拿起从IIS IO线程和岗位HSE_STATUS_PENDING到IIS IO线程结果的请求
2.请求移交给一个CLR工作线程结果
3.如果请求是高延迟的,所有的线程被占用(线程数接近httpRuntime.minFreeThreads),然后将请求发布到应用级请求队列(此队列为每个AppDomain)结果
4.还ASP.NET检查排队并接受新的请求之前正在执行的请求的数目。如果这个数字比processModel.requestQueueLimit规定值,则传入请求将与503服务器忙错误而被拒绝。

Update 2 There was a mistake in my part in the understanding. I had mixed up the descriptions for IIS 6 and IIS 7.
Essentially when ASP.NET is hosted on IIS 7.5 and 7.0 in integrated mode, the application-level queues are no longer present, ASP.NET maintains a global request queue.
So IIS 7/7.5 will start to queue requests to the global request queue if the number of executing requests is deemed high. The question applies more to IIS 7/7.5 rather than 6.

As far IIS 6.0 is concerned, there is no global ASP.NET request queue, but the following is true:
1. ASP.NET picks up the requests from a IIS IO Thread and posts "HSE_STATUS_PENDING" to IIS IO Thread
2. The requests is handed over to a CLR Worker thread
3. If the requests are of high latency and all the threads are occupied (the thread count approaches httpRuntime.minFreeThreads), then the requests are posted to the Application level request queue (this queue is per AppDomain)
4. Also ASP.NET checks the number of requests queued and currently executing before accepting a new request. If this number is greater than value specified by processModel.requestQueueLimit then incoming requests will be rejected with 503 server busy error.

推荐答案

这篇文章可能有助于更好一点了解的设置。

This article might help to understand the settings a little better.

minFreeThreads::此设置用于工作进程队列中的所有传入的请求,如果可用线程的数量
  线程池低于此设置的值。此设置
  有效地限制了可以同时运行的请求数
  maxWorkerThreads minFreeThreads。将minFreeThreads 88 *#的
  的CPU。这限制并发请求到12的数目(假定
  maxWorkerThreads为100)。

minFreeThreads: This setting is used by the worker process to queue all the incoming requests if the number of available threads in the thread pool falls below the value for this setting. This setting effectively limits the number of requests that can run concurrently to maxWorkerThreads minFreeThreads. Set minFreeThreads to 88 * # of CPUs. This limits the number of concurrent requests to 12 (assuming maxWorkerThreads is 100).

编辑:

在此 SO帖子,托马斯提供了更多细节,并请求在综合管线处理的例子。请务必阅读的答案补充说明的意见。

In this SO post, Thomas provides more detail and examples of request handling in the integrated pipeline. Be sure to read the comments on the answer for additional explanations.

一个回调本地人(在webengine.dll)拿起上的CLR工人要求
  螺纹,我们比较的 maxConcurrentRequestsPerCPU * CPUCount 以总
  主动请求。如果我们超出限制,要求插入
  全局队列(本地code)。否则,它会被执行。如果它是
  排队,将当活性请求中的一个完成出队

A native callback (in webengine.dll) picks up request on CLR worker thread, we compare maxConcurrentRequestsPerCPU * CPUCount to total active requests. If we've exceeded limit, request is inserted in global queue (native code). Otherwise, it will be executed. If it was queued, it will be dequeued when one of the active requests completes.

这篇关于ASP.NET IIS - 当请求排队?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆