简体   繁体   English

从IIS 6升级到8.5:并发请求增加

[英]Upgrading from IIS 6 to 8.5: increased concurrent requests

We upgraded our web server from Windows Server 2003 to Windows Server 2012 R2. 我们已将Web服务器从Windows Server 2003升级到Windows Server 2012 R2。 The web application in question runs against ASP.NET 4.0. 有问题的Web应用程序可在ASP.NET 4.0上运行。 The web application in turn communicates with a third-party Web API. Web应用程序又与第三方Web API通信。

Shortly after the upgrade, the Web API latency increased, which in turn lead to notable timeouts. 升级后不久,Web API延迟增加,从而导致明显的超时。 I suspected that on IIS 8.5, the number of allowed concurrent requests increased, causing an increase in throughput that the Web API was unable to handle. 我怀疑在IIS 8.5上,允许的并发请求数增加了,导致Web API无法处理的吞吐量增加了。 However: 然而:

  • IIS 6 isn't limiting the number of concurrent requests. IIS 6并没有限制并发请求的数量。 The help file reads: You can configure Internet Information Services (IIS) to allow an unlimited number of concurrent connections, or to limit the number of connections it accepts for this Web site. 帮助文件显示为: 您可以配置Internet信息服务(IIS),以允许无限数量的并发连接,或限制该网站接受的连接数量。 We currently have this set to unlimited. 目前,我们将此设置为无限制。
  • Both IIS 6 and IIS 8.5 are using ASP.NET 4 which also has the ability to limit the number of concurrent requests. IIS 6和IIS 8.5都使用ASP.NET 4,它也具有限制并发请求数的能力。 Both IIS versions are set to auto-config in the machine.config file; 两种IIS版本都在machine.config文件中设置为auto-config。 since both servers have the same processor and RAM configuration, they should be using the same settings. 由于两台服务器具有相同的处理器和RAM配置,因此它们应使用相同的设置。

When we rolled back the upgrade, the latency shortly after dropped. 当我们回滚升级时,延迟很快就下降了。 Unlikely a coincidence, so with everything else remaining the same, there must be something intrinsic about Windows 2012 R2 or IIS 8.5 that's affecting the Web API. 不太可能是巧合,因此在其他所有条件不变的情况下,Windows 2012 R2或IIS 8.5必须具有某些内在因素,这些因素会影响Web API。 The 3rd party Web API developers confirmed that nothing had changed in their space, and unfortunately there isn't any additional information that I can gather. 第三方Web API开发人员确认,他们的空间没有任何变化,不幸的是我没有任何其他信息可以收集。

I checked the IIS logs for both version 6 and 8.5: the average (and median) requests per second, minute, and hour indicate there were more requests being processed on IIS 8.5 (I used Log Parser Studio to analyse the logs). 我检查了版本6和8.5的IIS日志:每秒,分钟和小时的平均(和中位数)请求表明在IIS 8.5上有更多的请求正在处理(我使用Log Parser Studio分析日志)。 However, there is nothing to indicate that this should be the case. 但是,没有任何迹象表明应该是这种情况。 Does anyone have any insight or suggestions? 有没有人有见识或建议? If there are settings controlling this, then for now I'd like the web application to behave in the same on Windows Server 2003 and 2012 R2. 如果有设置可以控制此设置,那么现在我希望Web应用程序在Windows Server 2003和2012 R2上具有相同的行为。

Since each new request is processed on a new worker thread from the thread pool, I queried the thread pool limits to verify that the auto-configured settings match ( aspx file): 由于每个新请求都是在线程池中的新工作线程上处理的,因此我查询了线程池限制以验证自动配置的设置是否匹配( aspx文件):

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Threading" %>
<html>
  <body>
    <div>
    <% 
      int workers;
      int io;
      ThreadPool.GetMaxThreads(out workers, out io);
    %>
    The maximum number of worker threads is <%=workers.ToString()%> and 
    the maximum number of IO threads is <%=io.ToString()%>
    </div>
  </body>
</html>

The results are as follows (the virtual machine had 2 cores): 结果如下(虚拟机具有2个内核):

  • On Windows Sever 2003, running IIS 6: 200 worker, and 200 I/O thread limit 在Windows Sever 2003上,运行IIS 6:200个工作程序和200个I / O线程限制
  • On Windows Server 2012 R2, running IIS 8.5: 32767 worker, and 1000 I/O thread limit 在Windows Server 2012 R2上,运行IIS 8.5:32767工作程序和1000个I / O线程限制

This implies that the newer setup is able to handle more requests concurrently. 这意味着较新的设置能够同时处理更多请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM