Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lambda Throttling Scenario

We are using Lambda subscribed to SNS to process the messages. Lambda has a safety limit of 100 concurrent invocations at any time. So what happens to the throttled events ? Are they rejected or they are added to the queue to process them later ?

[Pages Visited]

  • Link1 says that Lambda functions being invoked asynchronously can absorb reasonable bursts of traffic for approximately 15-30 minutes, after which incoming events will be rejected as throttled.
  • Link2 says that if your Lambda function is invoked asynchronously and is throttled, AWS Lambda automatically retries the throttled event for up to six hours, with delays between retries. Asynchronous events are queued before they are used to invoke the Lambda function.
like image 653
Kartik Goyal Avatar asked Oct 11 '16 18:10

Kartik Goyal


People also ask

What happens if Lambda is throttled?

At the highest level, throttling just means that Lambda will intentionally reject one of your requests and so what we see from the user side is that when making a client call, Lambda will throw a throttling exception, which you need to handle. Typically, people handle this by backing off for some time and retrying.

What happens if Lambda it runs for more than 15 minute?

If you're doing some sort of long running processing then your other option may be to run this task on an EC2 instance. If this long running process can be broken down in to multiple steps then you could look in to Lambda Step Functions. 15 Minutes is the max and this max can not be extended.

How much TPS can Lambda handle?

With increased concurrent execution limit, there is still one more limit the Burst Concurrency limit. This will limit lambda to serve only 3000 concurrent request at time. If it receives more than 3000 concurrent requests some of them will be throttled until lambda scales by 500 per minute.


1 Answers

You can increase your concurrent limit by requesting an increase. I would assume that a throttled event would be treated like any failed event. Per the documentation it is retired twice then discarded. You can setup a Dead Letter Queue (DLQ). Failed events will be added to the configured queue and they can be re-picked up for processing. I'm also not sure if you get an error reason or not in the message in the queue so a throttled event may look the same as a failed event (not sure if that would matter to you or not). You can also monitor throttles via CloudWatch, but this would not contain the event information necessary to replay the event.

like image 118
Jarred Olson Avatar answered Oct 04 '22 15:10

Jarred Olson