AWS Lambda TooManyRequestsException: Speeding

When trying to execute the Amazon Web Services (AWS) Lambda function (many times), we saw an error:

AWS Lambda TooManyRequestsException: Rate Exceeded

How do we resolve this?

+13
amazon-web-services rate-limiting aws-lambda serverless
source share
2 answers

As Michael noted, this is an error message that you will see when you reach the default documented " security " limit of 100 simultaneous calls :

"AWS Lambda has a standard security choke of 100 simultaneous executions for each account for each region. If you want to send a request to increase the throttle of 100 simultaneous executions, you can visit our Support Center ...

The solution was to open a support ticket containing the following information:

 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 evaluate 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 

It may take some time to get an answer from AWS support if you don’t pay for premium support, so it’s best to download a test application during development / creation and request to increase concurrent calls until you launch your application!

In our case, it took 45 hours from the initial support request to increase the call limit. aws-lambda-limits-increase-requestaws-lambda-limits-request-sorted

The people who support AWS are great, they just felt like they were like centuries (almost two days!) To improve the service, which would be fatal if our launch was public!

+24
source share

I had this problem when I set Standby concurrency below 100. And used aws-sdk to send more than 100 requests at a time.

In fact, when the reserved concurrency is relatively low, any concurrency request in your concurrency setting (for example, sending 21 concurrency requests when concurrency is 20) will throw a TooManyRequestsException . I'm not sure if this is my account problem or just @nelsonic memtioned: default limitation.

But when I increase my parallelism by at least 100, if it doesn’t work, I continue to increase, then the problem is solved. Hope this helps.

0
source share

All Articles