设置ASPNET:requestQueuelimitpersession如何在ASP.NET核心中起作用?

发布于 2025-02-09 17:03:39 字数 978 浏览 1 评论 0原文

背景:我们在ASP.NET网站中遇到了这个不便问题,在某个情况下,浏览器向服务器发出了大量请求,并且自从通过HTTP/2进行通信并利用并发请求机制超过ASP.NET请求队列限制(*),因此请求终止并从服务器返回Nasty 500。

(*)是的,因为存在的原因 - https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/migration-guide/retargeting/4.6.2-4.6.2-4.7.1#throttle-concurrent - 重新审议的每届会议

当然,一种处理此操作的方法是更好的懒惰加载处理,以防止立即发射大量请求(这是针对这种特定情况进行的)。

但是,另一种方式,以及我们发现的作为使此会话请求队列限制与并发请求更好地合作的更整体解决方案,就是通过碰撞设置aspnet:requestequequeuelimitpersession来调整此队列限制,此线程会话的请求队列限制已超过

但是,我们对此设置如何使用ASP.NET核心项目运作不安全?我们似乎找不到有关此信息的任何信息,或者有关该请求队列限制如何与并发请求的整体联系。有人在ASP.NET核心中有有关此设置的经验和一些信息吗?

Background: we ran into this inconvenient issue in our ASP.NET site where in one scenario the browser fired a huge number of request to the server, and since communicating over http/2 and utilizing concurrent request mechanism the ASP.NET request queue limit (*) was exceeded whereupon the requests get terminated and nasty 500 is returned from the server.

(*) yes, because reasons, that exists - https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/retargeting/4.6.2-4.7.1#throttle-concurrent-requests-per-session)

One way to handle this is of course with better lazy loading handling to prevent the huge number of requests being fired at once (this has been done for this specific scenario).

However, another way, and what we find as a more overall solution for making this session request queue limit cooperate better with concurrent requests, is to tweak this queue limit by bumping setting aspnet:RequestQueueLimitPerSession, as discussed in this thread The request queue limit of the session is exceeded

However, we are insecure on how this setting are operating with ASP.NET Core projects? We can’t seem to find any information whatsoever regarding this, or information regarding how this request queue limit is set to work with concurrent requests overall. Does anyone have experience and some information regarding this setting in ASP.NET Core?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文