http.sys LimitExceeded 错误

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 -

那么我如何知道超出了哪个限制以及如何更改该限制?

答案1

在浪费了一周时间并损失了大量金钱之后,偶然发现了这个可以追溯到 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 套接字连接。

相关内容