How are IIS7 threads assigned?(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.
推荐答案
这解释了你需要知道的一切.
This explains all you need to know.
摘录:
当 ASP.NET 托管在 IIS 7.0 中时集成模式,线程的使用是有点不同.首先,应用程序级队列已不复存在.他们的表现总是真的糟糕,没有希望解决这个问题,所以我们摆脱了他们.但也许最大的不同是在 IIS6.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 线程是如何分配的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:IIS7 线程是如何分配的?
基础教程推荐
- rabbitmq 的 REST API 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 将 XML 转换为通用列表 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01