Windows
http.sys LimitExceeded 錯誤
我們在 Windows Server 2016 上的 IIS 後面託管了一個 ASP.NET Core 3.0 應用程序。在高負載(5,000 多個並髮使用者)下,我們開始收到 503 錯誤消息“服務不可用”。
我檢查了日誌
%SystemRoot%\System32\LogFiles\HTTPERR
並意識到它們主要是由於“LimitExceeded”。以下是一些範例數據:2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 205 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 207 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 209 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 211 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 213 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 215 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 217 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 219 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 221 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 223 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 225 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 227 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 229 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 231 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 233 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 235 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 237 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 239 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 241 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 243 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 245 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 247 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 249 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 251 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 253 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 255 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 257 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 259 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 261 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 263 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 265 - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - 267 - - LimitExceeded - 2019-11-22 20:36:33 5.113.159.51 47537 185.211.56.203 443 - - - - - - Client_Reset - 2019-11-22 20:36:33 5.125.149.3 54861 185.211.56.203 443 HTTP/2.0 GET /api/messaging/checkcallcompatibility 72959 - 7 Client_Reset patogh.me(domain)(4.0)(pool) 2019-11-22 20:36:33 5.112.111.38 36112 185.211.56.203 443 - - - - - - ClientCancel - 2019-11-22 20:36:33 5.121.34.242 55374 185.211.56.203 443 HTTP/2.0 GET /api/messaging/checkcallcompatibility 94051 - 7 Client_Reset patogh.me(domain)(4.0)(pool) 2019-11-22 20:36:33 83.122.43.131 34801 185.211.56.203 443 - - - - - - LimitExceeded - 2019-11-22 20:36:33 5.119.159.122 51429 185.211.56.203 443 - - - - - - LimitExceeded - 2019-11-22 20:36:33 5.74.28.250 12622 185.211.56.203 443 - - - - - - Client_Reset - 2019-11-22 20:36:33 5.112.111.38 36113 185.211.56.203 443 - - - - - - Client_Reset - 2019-11-22 20:36:33 89.196.176.185 38334 185.211.56.203 443 HTTP/2.0 GET /api/messaging/checkcallcompatibility 4921 - 7 Client_Reset patogh.me(domain)(4.0)(pool) 2019-11-22 20:36:34 5.121.34.242 55374 185.211.56.203 443 HTTP/2.0 GET /api/messaging/checkcallcompatibility 94065 - 7 Client_Reset patogh.me(domain)(4.0)(pool) 2019-11-22 20:36:34 91.251.90.58 43009 185.211.56.203 443 HTTP/2.0 GET /api/messaging/checkcallcompatibility 68999 - 7 Client_Reset patogh.me(domain)(4.0)(pool) 2019-11-22 20:36:34 5.112.111.38 36115 185.211.56.203 443 - - - - - - Client_Reset - 2019-11-22 20:36:34 172.80.200.76 56406 185.211.56.203 443 - - - - - - Client_Reset -
那麼我如何知道超出了哪個限制以及如何更改該限制?
在浪費了一周並損失了很多錢之後,偶然發現了這個可以追溯到 2012 年的教程。
https://github.com/SignalR/SignalR/wiki/Performance
顯然,IIS 處理的每個應用程序的最大並發請求數有 5,000 個荒謬的限制。所以我執行下面的命令
%windir%\System32\inetsrv\
將其更改為 50,000。appcmd.exe set config /section:system.webserver/serverRuntime /appConcurrentRequestLimit:50000
當 web 套接字不是一個東西並且伺服器沒有足夠強大來處理更多請求時,這個限制可能已經足夠高了。現在大多數伺服器可以很容易地處理數以萬計的並發請求,並且許多應用程序需要持久的 Web 套接字連接。