AWS Lambda TooManyRequestsException:超出速率 [英] AWS Lambda TooManyRequestsException: Rate Exceeded
问题描述
当尝试执行Amazon Web Services(AWS)Lambda函数(很多次)时,我们看到错误:
When attempting to execute an Amazon Web Services (AWS) Lambda function (many times) we were seeing the error:
AWS Lambda TooManyRequestsException: Rate Exceeded
我们如何解决这个问题?
How do we resolve this?
推荐答案
正如 Michael 所指出的,这是当您到达记录在案的 安全 "的"限制",<强大的> 100个并发调用 :
As noted by Michael, this is the error message you will see when you reach the documented default "safety" limit of 100 concurrent invocations:
" AWS Lambda的每个区域每个帐户的默认安全限制为 100个并发执行次数.如果您希望提交将限制提高为100的请求您可以访问我们的支持中心 ..."
"AWS Lambda has a default safety throttle of 100 concurrent executions per account per region. If you wish to submit a request to increase the throttle of 100 concurrent executions you can visit our Support Center..."
解决方案是打开一张提供以下信息的支持凭单:
The solution was to open a support ticket providing the following info:
Limit increase request 1
Service: Lambda
Region: EU (Ireland)
Limit name: concurrent requests (average duration * average TPS)
New limit value: 2000
然后在票证/请求的正文中尝试估计您的使用模式:
And then in the body of the ticket/request try to estimate your usage pattern:
Expected average requests per second: 200
Expected peak requests per second: 2000
Expected function duration: 2 seconds
Function memory size: 1000mb
Invocation Type: Request-response
Event Source: Api Gateway & Lambda<->Lambda
除非您为高级支持付费,否则可能需要一段时间才能获得AWS Support的响应,因此最好在开发/登台和请求增加并发调用 ,然后再启动您的应用程序!
It can take a while to get a response from AWS Support unless you are paying for premium support, so its best to load test your app during development/staging and request to increase concurrent invocations before you launch your app!
在我们的案例中,从最初的支持请求开始,花费了 45小时来增加调用限制.
In our case it took 45 hours from initial support request to get the invocation limit increase.
AWS支持人员非常可爱,仅仅花费了 age (近两天!)的时间,服务水平就提高了,这如果致命的话我们的发布是公开的!
The AWS support people are lovely, it just took what felt like ages (almost two days!) to get the service level increase, which would have been fatal if our launch had been public!
这篇关于AWS Lambda TooManyRequestsException:超出速率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!