限制 Azure 应用服务中的并发请求

编程入门 行业动态 更新时间:2024-10-26 00:26:49
本文介绍了限制 Azure 应用服务中的并发请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

鉴于以下

  • ASP.NET Web API 应用程序
  • 目标:.NET Framework 4.6.1
  • 作为 Azure 应用服务托管

我希望限制应用程序的并发 HTTP 请求总数.

I wish to restrict the total number of concurrent HTTP requests to the application.

我看过 github/stefanprodan/WebApiThrottle 但这似乎专注于不同的用例.

I have looked at github/stefanprodan/WebApiThrottle but that seems to be focused on different use cases.

我想要 IIS 中的此设置的等效项:forums.asp/t/1683143.aspx?Max+concurrent+requests

I would like the equivalent of this setting in IIS: forums.asp/t/1683143.aspx?Max+concurrent+requests

推荐答案

这是为了避免以适得其反的方式攻击后端服务.

This is to avoid attacking a backend service in counterproductive ways.

为避免攻击,您可以使用动态 IP 限制来限制并发请求.如果并发请求数大于设置值,IP地址将被阻塞.

To avoid the attack, you could restrict the concurrent requests using Dynamic IP Restrictions. If the concurrent requests count is larger than the setting value, the IP address will be blocked.

<system.webServer> <security> <dynamicIpSecurity> <denyByConcurrentRequests enabled="true" maxConcurrentRequests="30"/> <denyByRequestRate enabled="true" maxRequests="30" requestIntervalInMilliseconds="2000"/> </dynamicIpSecurity> </security> </system.webServer>

如需了解更多信息,请参考以下链接.

For more information, link below is for your reference.

在 Windows Azure 网站中配置动态 IP 地址限制

更多推荐

限制 Azure 应用服务中的并发请求

本文发布于:2023-11-06 09:45:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563350.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用服务   Azure

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!