asp.net - 是否可以告诉 IIS 7 并行处理请求队列?

标签 asp.net iis iis-7 asmx application-pool

目前我们正在开发一个 ASMX、ASP 2.0、IIS 7 Web 服务,该服务会执行一些计算(并返回动态生成的文档),大约需要 10 分钟。运行时间为 60 秒。

由于拥有一台具有多个内核和大量 RAM 的大型计算机,我希望 IIS 会尽力将到达其请求队列的请求路由到应用程序池线程池的所有可用线程。

但我们体验到的安静恰恰相反:

当我们从多个不同的客户端向 ASMX Web 服务 URL 发出请求时,IIS 似乎会串行处理这些请求。 IE。请求 1 到达,正在处理,然后请求 2 正在处理,然后请求 3,等等。

问题:

如果有足够的线程可用,是否可以(无需更改 Web 服务的 C# 代码)将 IIS 配置为并行处理请求?

  • 如果:我应该怎么做?
  • 没有:有任何解决方法/提示吗?

最佳答案

确保应用程序池的“最大工作进程”设置为 > 1,以使工作池成为 Web Garden 。默认情况下,每个应用程序池设置为仅使用一个进程,这将导致请求排队。

您可能还想查看这篇有关使用 ASP.NET 2.0 in Integrated mode on IIS7 的文章

  1. ASP.NET threading settings are not used to control the request concurrency in Integrated mode

The minFreeThreads, minLocalRequestFreeThreads settings in the system.web/httpRuntime configuration section and the maxWorkerThreads setting in the processModel configuration section no longer control the threading mechanism used by ASP.NET. Instead, ASP.NET relies on the IIS thread pool and allows you to control the maximum number of concurrently executing requests by setting the MaxConcurrentRequestsPerCPU DWORD value (default is 12) located in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\2.0.50727.0 key. This setting is global and cannot be changed for individual application pools or applications. Workaround

A. To control the concurrency of your application, set the MaxConcurrentRequestsPerCPU setting.

关于asp.net - 是否可以告诉 IIS 7 并行处理请求队列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2672453/

相关文章:

c# - 无法连接到 .mdf 数据库

javascript - 使用 JavaScript 或 jQuery 延迟加载页面内容

c# - .net web api 服务器中的静态变量

asp.net - 模拟与我的 .NET Winform 或 ASP.NET 应用程序交互的虚拟用户?

asp.net - 如何保护已经使用 Forms 身份验证的 ASP .NET 网站?

asp.net - 捕获 IIS 级别的错误以在 ASP.NET 中处理

c# - ASP.Net MVC 存储在资源中或作为内容

java - 需要在 Windows 2008 R2 上的压缩文件中按天导出 IIS 日志和 Tomcat 日志

asp.net - 发布具有多个项目的 Web 应用程序

iis - 如何解决错误 "It has taken too long to refresh the W3SVC counters, the stale counters are being used instead"