DVA-C02 Question 391
Select 2You are developing a serverless application using AWS Lambda that processes a batch of incoming messages from an Amazon SQS queue. You notice that the processing of messages is slower than expected due to concurrency limits. Which of the following actions can you take to increase the concurrency and improve message processing performance?
- A
Increase the reserved concurrency limit for the Lambda function.
- B
Enable SQS long polling to reduce the number of empty responses.
- C
Increase the batch size of messages retrieved from the SQS queue.
- D
Set a higher delay time for the SQS messages to spread processing.
- E
Adjust the maximum concurrency value for the Lambda function to be unlimited.
Show answer and explanation
Correct answers: A, C
Explanation
To improve concurrency and message processing performance for a Lambda function integrated with an SQS queue, you can increase the reserved concurrency limit for the Lambda function, which allows more simultaneous executions. Additionally, increasing the batch size of messages retrieved by the function allows it to process more messages in a single invocation, enhancing throughput. Other options like enabling long polling or setting higher delay times do not directly address concurrency issues.
- A. Correct.
Increasing the reserved concurrency limit for the Lambda function allows more concurrent executions of the function, which can improve the processing of SQS messages.
- B. Incorrect.
Enabling SQS long polling reduces the number of empty responses but does not directly impact the concurrency or speed of processing messages.
- C. Correct.
Increasing the batch size of messages retrieved from the SQS queue helps process more messages in a single invocation, which can improve throughput and reduce latency.
- D. Incorrect.
Setting a higher delay time for the SQS messages delays their processing and does not help in improving concurrency or message processing speed.
- E. Incorrect.
Adjusting the maximum concurrency value for a Lambda function to unlimited is not a valid option because Lambda's concurrency behavior is managed using reserved concurrency or account-level concurrency limits.