A Lambda function behind API Gateway has predictable traffic spikes every hour. The function does not need access to resources in a VPC, and p95 latency spikes are caused by cold starts during scale-out. Which two actions are most effective? Select two.
Trap 1: Set reserved concurrency to a low fixed number.
Reserved concurrency limits the maximum number of simultaneous executions, but it does not pre-initialize environments or reduce the time needed to start them. In this scenario, it could even make bursts worse by capping throughput too aggressively.
Trap 2: Increase the Lambda timeout to 15 minutes.
Timeout only controls how long a function is allowed to run before it is terminated. It does not affect initialization time, cold starts, or how quickly the function scales out.
Trap 3: Add an SQS dead-letter queue to reduce startup latency.
A dead-letter queue helps capture failed messages for later inspection or replay. It is useful for reliability, but it has no effect on Lambda initialization performance or cold-start latency.
- A
Enable provisioned concurrency for the function.
Provisioned concurrency keeps a pool of initialized execution environments ready to handle requests. That removes most cold-start delay and is the most direct way to stabilize p95 latency during predictable bursts.
- B
Remove the function from a VPC because it has no VPC dependencies.
If the function does not need private network access, keeping it out of a VPC avoids the extra networking setup associated with VPC-enabled Lambdas. That reduces startup overhead and helps new execution environments become available faster.
- C
Set reserved concurrency to a low fixed number.
Why wrong: Reserved concurrency limits the maximum number of simultaneous executions, but it does not pre-initialize environments or reduce the time needed to start them. In this scenario, it could even make bursts worse by capping throughput too aggressively.
- D
Increase the Lambda timeout to 15 minutes.
Why wrong: Timeout only controls how long a function is allowed to run before it is terminated. It does not affect initialization time, cold starts, or how quickly the function scales out.
- E
Add an SQS dead-letter queue to reduce startup latency.
Why wrong: A dead-letter queue helps capture failed messages for later inspection or replay. It is useful for reliability, but it has no effect on Lambda initialization performance or cold-start latency.