Upgrading from IIS 6 to 8.5: increased concurrent requests

怎甘沉沦 提交于 2019-12-11 19:41:13

问题


We upgraded our web server from Windows Server 2003 to Windows Server 2012 R2. The web application in question runs against ASP.NET 4.0. The web application in turn communicates with a third-party Web API.

Shortly after the upgrade, the Web API latency increased, which in turn lead to notable timeouts. 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. However:

  • IIS 6 isn't limiting the number of concurrent requests. 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. 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. Both IIS versions are set to auto-config in the machine.config file; since both servers have the same processor and RAM configuration, they should be using the same settings.

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. 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.

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). 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.


回答1:


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):

<%@ 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):

  • On Windows Sever 2003, running IIS 6: 200 worker, and 200 I/O thread limit
  • On Windows Server 2012 R2, running IIS 8.5: 32767 worker, and 1000 I/O thread limit

This implies that the newer setup is able to handle more requests concurrently.



来源:https://stackoverflow.com/questions/33709657/upgrading-from-iis-6-to-8-5-increased-concurrent-requests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!