從 IIS 6 升級到 8.5:增加並發請求 (Upgrading from IIS 6 to 8.5: increased concurrent requests)


問題描述

從 IIS 6 升級到 8.5:增加並發請求 (Upgrading from IIS 6 to 8.5: increased concurrent requests)

我們將 Web 服務器從 Windows Server 2003 升級到了 Windows Server 2012 R2。有問題的 Web 應用程序針對 ASP.NET 4.0 運行。Web 應用程序又與第三方 Web API 通信。

升級後不久,Web API 延遲增加,進而導致明顯的超時。我懷疑在 IIS 8.5 上,允許的並發請求數增加,導致 Web API 無法處理的吞吐量增加。但是:

  • IIS 6 不限制並發請求的數量。幫助文件內容如下:您可以將 Internet 信息服務 (IIS) 配置為允許無限數量的並發連接,或限制它為此網站接受的連接數量。我們目前將此設置為無限制。
  • IIS 6 和 IIS 8.5 都使用 ASP.NET 4,它還可以限制並發請求的數量。兩個 IIS 版本都在 machine.config 文件中設置為自動配置;由於兩台服務器具有相同的處理器和 RAM 配置,它們應該使用相同的設置。

當我們回滾升級時,延遲很快就下降了。不太可能是巧合,所以在其他一切都保持不變的情況下,Windows 2012 R2 或 IIS 8.5 一定有一些內在的東西會影響 Web API。第 3 方 Web API 開發人員確認他們的空間沒有發生任何變化,不幸的是,我無法收集到任何其他信息。

我檢查了 IIS 6 和 8.5 的日誌:每秒、每分鐘和每小時的平均(和中值)請求表明在 IIS 8.5 上處理的請求更多(我使用 Log Parser Studio 分析日誌)。但是,沒有任何跡象表明應該如此。有沒有人有任何見解或建議?如果有控制這一點的設置,那麼現在我希望 Web 應用程序在 Windows Server 2003 和 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.

(by PoovenPooven)

參考文件

  1. Upgrading from IIS 6 to 8.5: increased concurrent requests (CC BY‑SA 2.5/3.0/4.0)

#ASP.NET #windows-server-2003 #windows-server-2012-r2 #iis-8.5 #iis-6






相關問題

System.Reflection.Assembly.LoadFile 鎖定文件 (System.Reflection.Assembly.LoadFile Locks File)

如何在沒有全局變量的情況下一直保留我的變量? (How can I keep my variable all the time without global variables?)

C# / ASP.NET - Web 應用程序鎖定 (C# / ASP.NET - Web Application locking)

關閉模態對話框窗口後 ASP.NET 刷新父頁面 (ASP.NET Refresh Parent Page after Closing Modal Dialog Window)

無法將 NULL 值傳遞給數據庫 (Unable to pass NULL value to database)

wcf:將用戶名添加到消息頭是否安全? (wcf: adding username to the message header is this secure?)

使用 ASP.Net 教初學者 Web 開發的小項目想法 (Small projects ideas to teach beginners web development using ASP.Net)

SQL Server - 分組、擁有和計數 (SQL Server - Group by, having and count in a mix)

企業庫異常處理應用程序塊和日誌記錄應用程序塊在 ASP.NET 中的正確使用 (Enterprise Library Exception Handling Application Block and Logging Application Block proper use in ASP.NET)

來自proc的asp.net多個結果集:是否有必要將結果映射到類?如果是這樣,怎麼做? (asp.net multiple result set from proc: is it necessary to map results to class? If so, how?)

如何在測試工具中實例化 asp.net 代碼隱藏類? (How can I instantiate an asp.net codebehind class in a test harness?)

Web 窗體用戶控制事件,需要在頁面加載後添加 (Web Form User Control Event, needs to be added after page loads)







留言討論