A developer has an AWS Lambda function that processes messages from an Amazon SQS queue. The function is configured with a batch size of 10, reserved concurrency of 5, and a timeout of 5 minutes. The SQS queue has a large backlog, and CloudWatch metrics show high throttling (Throttles) for the Lambda function. The function is idempotent and can process up to 100 messages in a single invocation. What is the MOST effective way to increase throughput without increasing the reserved concurrency?
Trap 1: Increase the reserved concurrency to 10.
The requirement is to NOT increase reserved concurrency. Increasing reserved concurrency would allow more concurrent executions but violates the constraint.
Trap 2: Reduce the batch size to 1.
Reducing the batch size would increase the number of invocations, leading to more throttling and lower throughput.
Trap 3: Enable the SQS queue to use long polling.
Long polling helps reduce empty responses and cost, but it does not directly increase throughput or reduce throttling. The issue is throttling due to insufficient capacity per invocation.
- A
Increase the batch size to 100.
Increasing the batch size allows each invocation to process more messages, reducing the number of invocations and the likelihood of throttling without increasing reserved concurrency.
- B
Increase the reserved concurrency to 10.
Why wrong: The requirement is to NOT increase reserved concurrency. Increasing reserved concurrency would allow more concurrent executions but violates the constraint.
- C
Reduce the batch size to 1.
Why wrong: Reducing the batch size would increase the number of invocations, leading to more throttling and lower throughput.
- D
Enable the SQS queue to use long polling.
Why wrong: Long polling helps reduce empty responses and cost, but it does not directly increase throughput or reduce throttling. The issue is throttling due to insufficient capacity per invocation.