IIS7.5/MVC 限制托管线程数
我试图限制在 Windows Server 2008 上的 IIS7.5 下运行的 ASP.NET MVC 应用程序允许的托管线程数。我尝试了多种不同的方法,但似乎都没有按预期工作,我需要 报告的线程数
限制Threading.Thread.CurrentThread.ManagedThreadId
我还尝试更改每个处理器限制的 ASP/behaviour/limits 属性/线程,但我仍然得到具有不同线程 id 的新线程。
我确实需要有限数量的线程(例如 5-10 个),并且每次使用时每个线程都具有相同的线程 id。
目前,我有
<configuration>
<system.web>
<applicationPool maxConcurrentRequestsPerCPU="1" maxConcurrentThreadsPerCPU="1" requestQueueLimit="5000"/>
</system.web> </configuration>
applicationhost.config 指向的
<applicationPools>
<add name="DefaultAppPool" enable32BitAppOnWin64="true" CLRConfigFile="C:\Inetpub\wwwroot\SCRWeb\Data\apppool.config">
<processModel identityType="NetworkService" />
</add>
以下配置文件但我仍然在我的应用程序中看到超过 1 个线程 id,如 Threading.Thread.CurrentThread.ManagedThreadId 所报告的
有什么想法吗?
谢谢
I'm trying to limit the number of managed threads permitted by an ASP.NET MVC application running under IIS7.5 on Windows Server 2008. I've attempted a number of different approaches but none seem to have worked as expected, I need to limit the number of threads as reported by
Threading.Thread.CurrentThread.ManagedThreadId
I also tried changing the ASP/behaviour/limits properties/threads per processor limit but I still get new threads with a different thread id.
I really need a limited number of threads (say 5-10) with the same thread id for each one every time it's used.
At the moment I have the following config file
<configuration>
<system.web>
<applicationPool maxConcurrentRequestsPerCPU="1" maxConcurrentThreadsPerCPU="1" requestQueueLimit="5000"/>
</system.web> </configuration>
pointed to by applicationhost.config
<applicationPools>
<add name="DefaultAppPool" enable32BitAppOnWin64="true" CLRConfigFile="C:\Inetpub\wwwroot\SCRWeb\Data\apppool.config">
<processModel identityType="NetworkService" />
</add>
And yet I still see more than 1 thread id in my application as reported by Threading.Thread.CurrentThread.ManagedThreadId
Any ideas?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论