DVA-C02 Question 381
Single answerYou are developing a serverless e-commerce application using AWS Lambda. The application processes thousands of requests per second. You notice that the Lambda function's execution duration is increasing significantly, which is affecting the overall performance of the application. How can you optimize the Lambda function to improve its performance and reduce costs?
- A
Use AWS Lambda Provisioned Concurrency to pre-warm the function instances.
- B
Increase the timeout setting of the Lambda function to allow more time for execution.
- C
Use AWS Lambda Power Tuning to find the optimal memory allocation for the function.
- D
Enable AWS X-Ray tracing to identify and fix performance bottlenecks.
Show answer and explanation
Correct answer: C
Explanation
The AWS Lambda execution duration is influenced by the allocated memory size, which determines the available CPU power. AWS Lambda Power Tuning is a tool that helps find the ideal memory allocation for a specific workload, balancing performance and cost. This solution directly addresses the performance issue by optimizing the Lambda function's execution time and reducing costs.
- A. Incorrect.
Using AWS Lambda Provisioned Concurrency can help reduce cold start latency but does not directly address performance issues caused by inefficient resource allocation.
- B. Incorrect.
Increasing the timeout setting only allows the function to run longer but does not optimize its performance or reduce execution time.
- C. Correct.
AWS Lambda Power Tuning enables you to identify the optimal memory size allocation for your function, which directly impacts execution speed and cost efficiency. This is the best option for improving performance in this scenario.
- D. Incorrect.
While enabling AWS X-Ray tracing can help diagnose bottlenecks, it does not actively optimize the function's execution duration or performance.