IIS7线程是如何分配的? [英] How are IIS7 threads assigned?

查看:313
本文介绍了IIS7线程是如何分配的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加log4net的到我的应用程序,现在可以看到用户活动的线程ID,因为他们通过我的网站导航。有没有具体的算法来分配线程与IIS7如何发生的,或者是它只是一个随机数分配(我怀疑这是不是完全随机的,因为我的低流量的网站显示线程大多在10-30范围内)?任何最大可用线程数?我发现我的调度显示了一个奇怪的线程ID - 任何原因?调度是Quartz.net和ID表示为Scheduler_Worker-10,而不是仅仅一个数字。

I added log4net to my application and can now see the thread Ids of user activities as they navigate through my website. Is there any specific algorithm to how threads assignment happens with IIS7, or is it just a random number assignment (I suspect it's not completely random because my low traffic site show threads mostly in the range 10-30)? Any maximum to the number of threads available? And I notice that my scheduler shows up with a weird threads id -- any reason for this? The scheduler is Quartz.net and the id shows as "Scheduler_Worker-10", and not just a number.

推荐答案

<一个href=\"http://blogs.msdn.com/b/tmarq/archive/2007/07/21/asp-net-thread-usage-on-iis-7-0-and-6-0.aspx\">This解释了所有你需要知道的。

This explains all you need to know.

这是摘录:

当ASP.NET在IIS 7.0中托管
  集成模式,使用线程是
  有点不同。首先,在
  应用级队列没了。
  他们的表现总是真的
  坏了,没有希望在解决这个,
  所以我们摆脱了他们。但也许
  最大的区别是,在IIS
  6.0,或ISAPI模式,ASP.NET限制线程数并发
  执行的请求,但在IIS 7.0
  集成模式,ASP.NET限制
  同时执行数
  要求。差仅事项
  当请求是异步
  (请求或者具有一个
  异步处理程序中或在模块
  管道完成
  异步)。显然,如果
  多个请求是同步的,则
  同时执行数
  请求是相同的数
  线程并发执行
  请求,但如果请求是
  异步那么这两个数字
  可以像你可以很不同
  比线程更多个请求。

When ASP.NET is hosted on IIS 7.0 in integrated mode, the use of threads is a bit different. First of all, the application-level queues are no more. Their performance was always really bad, there was no hope in fixing this, and so we got rid of them. But perhaps the biggest difference is that in IIS 6.0, or ISAPI mode, ASP.NET restricts the number of threads concurrently executing requests, but in IIS 7.0 integrated mode, ASP.NET restricts the number of concurrently executing requests. The difference only matters when the requests are asynchronous (the request either has an asynchronous handler or a module in the pipeline completes asynchronously). Obviously if the reqeusts are synchronous, then the number of concurrently executing requests is the same as the number of threads concurrently executing requests, but if the requests are asynchronous then these two numbers can be quite different as you could have far more reqeusts than threads.

所以基本上,如果请求是同步的,相同数量的每个请求的线程。看到这里各种参数的。

So basically, if requests are synchronous, the same number of threads per request. See here for various parameters.

这篇关于IIS7线程是如何分配的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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