gpt4 book ai didi

amazon-web-services - AWS API网关端点速率限制

转载 作者:行者123 更新时间:2023-12-02 23:26:45 24 4
gpt4 key购买 nike

AWS API Gateway 提供了一种使用不同用户的使用计划对请求进行速率限制的方法。

但速率限制适用于所有端点。所以,如果我有 GET请求和另一个POST请求端点,我可以为 GET 设置不同的限制吗? POST 的请求和单独限制请求?

示例:

GET请求端点

https://aws.api.gateway/v1/get_data <- set rate limit to 10,000

POST请求端点

https://aws.api.gateway/v1/post_data <- set rate limit to 100

POST 请求是一项成本高昂的操作,因此我希望限制某个用户的请求数量,同时允许大量 GET请求。

要求基本上是对 2 个不同的端点有 2 个不同的速率限制。

最佳答案

您可以为两个不同的端点设置两个不同的速率限制。

如果您转到网关的阶段并单击其中一个端点,您将看到类似这样的内容...

Default settings

因此,默认情况下所有端点都使用您的阶段级速率限制。但是你选择“覆盖此方法”,你会得到这个...

Override settings

然后您可以为该 HTTP 方法设置方法级速率限制。

引用:http://docs.aws.amazon.com/apigateway/latest/developerguide/stages.html#how-to-stage-settings

  1. To override the stage-level throttling for individual methods, expand the stage under the Stages secondary navigation pane, choose a method of interest, and, back in the stage editor, choose Override for this method for Settings. In the Default Method Throttling area, select appropriate options.

关于amazon-web-services - AWS API网关端点速率限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46101097/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com