A serverless application contains multiple AWS Lambda functions. During peak traffic periods, a background data-processing function triggered by Amazon S3 events scales rapidly and consumes all of the available execution concurrency in the AWS Region. This causes customer-facing Lambda functions integrated with Amazon API Gateway to fail with throttling errors. Which configuration should a developer apply to prevent the background function from exhausting the available regional concurrency?
- AEnable provisioned concurrency on the customer-facing API Gateway-triggered Lambda functions.
- BConfigure an Amazon SQS queue between S3 and the background function, and set the queue's visibility timeout to zero.
- Configure a reserved concurrency limit on the background data-processing Lambda function.Answer
- DAttach a resource-based policy to the S3 bucket that limits the invocation rate of the background Lambda function.
Answer
Configure a reserved concurrency limit on the background data-processing Lambda function.
The correct answer is to configure a reserved concurrency limit on the background data-processing Lambda function. Setting a reserved concurrency limit on a Lambda function acts as a maximum concurrency cap (preventing it from scaling beyond that number and exhausting the region's shared unreserved pool) and also guarantees that the specified concurrency is dedicated to that function.
Step-by-Step Solution
Key Concept
Managing concurrency in AWS Lambda to prevent account-level resource starvation.