DVA-C02 · Question #535
A company is hosting an Amazon AP! Gateway REST API that calls a single AWS Lambda function. The function is infrequently invoked by multiple clients at the same time. The code performance is optimal,
The correct answer is B. Configure provisioned concurrency for the Lambda function.. Provisioned concurrency pre-initializes Lambda execution environments, eliminating cold start latency for infrequently invoked functions.
Question
A company is hosting an Amazon AP! Gateway REST API that calls a single AWS Lambda function. The function is infrequently invoked by multiple clients at the same time. The code performance is optimal, but the company wants to optimize the startup time of the function What can a developer do to optimize the initialization of the function?
Options
- AEnable API Gateway caching for the REST API.
- BConfigure provisioned concurrency for the Lambda function.
- CUse Lambda proxy integration for the REST API.
- DConfigure AWS Global Accelerator for the Lambda function.
How the community answered
(37 responses)- A5% (2)
- B76% (28)
- C5% (2)
- D14% (5)
Why each option
Provisioned concurrency pre-initializes Lambda execution environments, eliminating cold start latency for infrequently invoked functions.
API Gateway caching stores API responses to reduce backend invocations but does not affect Lambda initialization time when the function is actually invoked.
Provisioned concurrency keeps a specified number of Lambda execution environments initialized and ready to respond immediately. Because the function is infrequently invoked, it would otherwise experience cold starts (initialization time) on each invocation; provisioned concurrency removes this by pre-warming the environments before requests arrive.
Lambda proxy integration changes how API Gateway passes request data to Lambda but has no effect on Lambda startup or initialization performance.
AWS Global Accelerator optimizes network routing to AWS endpoints and is not applicable to Lambda functions; it does not address cold start issues.
Concept tested: Lambda provisioned concurrency to reduce cold starts
Source: https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html
Community Discussion
No community discussion yet for this question.