Q80 — AWS SAA-C03 Ch.10

Question 80 of 100 | ← Chapter 10

Q680. A company uses high concurrency AWS Lambda functions to process a constantly increasing number of messages in a message queue during marketing events. The Lambda functions use CPU intensive code to process the messages. The company wants to reduce the compute costs and to maintain service latency for its customers.Which solution will meet these reauirements?

Correct Answer: B. Configure reserved concurrency for the Lambda functions. Increase the memory according to AWS Compute Optimizer recommendations

Explanation

To reduce compute costs and maintain service latency for customers while using high-concurrency AWS Lambda functions that process a constantly increasing number of messages in a message queue with CPU-intensive code, the solution that will meet these requirements is B: Configure reserved concurrency for the Lambda functions and increase the memory according to AWS Compute Optimizer recommendations.AWS Lambda provides two important features that can help optimize cost and performance: reserved concurrency and memory allocation.\1. Configure reserved concurrency for the Lambda functions: Reserved concurrency allows you to limit the maximum number of concurrent executions of a function. By configuring reserved concurrency, you can control the number of simultaneous Lambda function invocations, ensuring that you don't exceed the desired concurrency level. This helps manage costs and prevents resource exhaustion. You can set the reserved concurrency based on the desired level of parallelism and the resources available.\2. Increase the memory according to AWS Compute Optimizer recommendations: AWS Compute Optimizer analyzes the historical resource utilization of your Lambda functions and provides recommendations to optimize their performance and cost. It can suggest an optimal memory allocation for the functions based on their usage patterns. By increasing the memory allocation, you can improve the performance of the CPU-intensive code running in the Lambda functions, reducing the processing time and maintaining service latency.Combining these two solutions, you can reduce compute costs by controlling the concurrency level with reserved concurrency and optimize performance by increasing the memory allocation based on Compute Optimizer recommendations.The other options are not the most suitable for meeting the requirements:A. Configuring reserved concurrency for the Lambda functions and decreasing the memory allocated to the functions may reduce costs but could negatively impact performance. CPU-intensive code typically benefits from higher memory allocations, as it allows for more processing capacity.C. Configuring provisioned concurrency for the Lambda functions and decreasing the memory allocated to the functions is not an optimal approach. Provisioned concurrency is used to reduce the cold start latency of Lambda functions, and decreasing the memory allocation may impact performance.D. Configuring provisioned concurrency for the Lambda functions and increasing the memory according to AWS Compute Optimizer recommendations is not the best combination of solutions for these requirements. The provisioned concurrency feature is primarily used to address cold start latency, and increasing the memory allocation based on Compute Optimizer recommendations may not directly optimize cost and service latency.Therefore, the correct answer is B. Configure reserved concurrency for the Lambda functions and increase the memory according to AWS Compute Optimizer recommendations.