Here’s how to avoid lambda throttling when lambda concurrency is limited:
The maximum concurrency setting limits the number of concurrent instances of the function that an Amazon SQS event source can invoke.
You can configure maximum concurrency on new and existing Amazon SQS event source mappings.
Reserved concurrency – Reserved concurrency is the maximum number of concurrent instances you want to allocate to your function. When a function has reserved concurrency, no other function can use that concurrency. There is no charge for configuring reserved concurrency for a function.
Put simply, if maximum concurrency is higher than the available concurrency, you will still experience the SQS overpull issue.
Configure maximum concurrency using the Lambda console
- Open the Functions page of the Lambda console.
- Choose the name of a function.
- Under Function overview, choose SQS. This opens the Configuration tab.
- Select the Amazon SQS trigger and choose Edit.
- For Maximum concurrency, enter a number between 2 and 1,000. To turn off maximum concurrency, leave the box empty.
- Choose Save.
Set in cloudformation
event source mapping ->scaling config->maximum concurrency