DVA-C02 practice question 3 of 35

A development learn has an Amazon API Gateway REST API that is backed by an AWS Lambda function. Users have reported performance issues for the Lambda function. The development team identified the source of the issues as a cold start of the Lambda function. The development team needs to reduce the time needed for the Lambda function to initialize. Which solution will meet this requirement?

Full set: 598 questions

Domain Development with AWS Services

Answer options
A: Change the Lambda concurrency lo reserved concurrency.
B: Increase the timeout of the Lambda function.
C: Increase the memory allocation of the Lambda function.
D: Configure provisioned concurrency for the Lambda function. Correct answer
Correct Answer:
D. Configure provisioned concurrency for the Lambda function.
Explanation

The core issue identified is the latency caused by Lambda "cold starts," which is the time it takes to initialize a new execution environment. Provisioned Concurrency is a feature specifically designed to solve this problem for latency-sensitive applications. It works by initializing a specified number of execution environments and keeping them "warm" and ready to respond instantly to incoming requests. By routing invocations to these pre-initialized environments, the cold start latency is completely eliminated for those requests, directly addressing the performance issue.

Why Incorrect

A. Reserved concurrency guarantees that a certain number of concurrent executions are available for a function, preventing it from being throttled, but it does not keep execution environments pre-initialized or "warm."
B. Increasing the function's timeout allows it to run for a longer duration before being terminated. It has no impact on the initial startup time or cold start latency.
C. Increasing memory allocation also increases CPU power, which can reduce the duration of a cold start. However, it does not prevent the cold start from occurring in the first place.

References

1. AWS Lambda Developer Guide, "Configuring provisioned concurrency": "For latency-sensitive applications, you can use provisioned concurrency to keep your functions initialized and warm, ready to respond in double-digit milliseconds. Provisioned concurrency is the number of pre-initialized execution environments that you allocate to your function."

2. AWS Lambda Developer Guide, "Lambda function scaling": This section contrasts the different concurrency controls. It explains that on-demand functions scale from zero, incurring a cold start, while "for functions with provisioned concurrency, Lambda pre-initializes the requested number of execution environments."

3. AWS Lambda Operator Guide, "Performance optimization - Function initialization": "To reduce the duration of initialization, we recommend that you... configure provisioned concurrency for any function that has strict cold start latency requirements." This explicitly recommends provisioned concurrency as the solution for the problem described.

Scroll to Top