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.
Raising the Lambda timeout to 15 minutes only changes the maximum execution duration for each invocation; it does not affect how quickly execution environments are initialized or how fast the service scales out. Cold starts occur when a new environment is provisioned, and a longer timeout does nothing to pre-warm environments or reduce the time taken to load the runtime and function code. In fact, a longer timeout could adversely affect performance by allowing slow invocations to occupy resources longer, and it does not address the root cause of startup latency.
Trap 3: Add an SQS dead-letter queue to reduce startup latency.
An SQS dead-letter queue (DLQ) is a reliability mechanism that captures failed event records for later debugging or replay, but it has no role in Lambda initialization or scaling. When Lambda is invoked asynchronously with an SQS source, the DLQ simply holds messages that exceeded retry limits; it does not pre-warm execution environments and cannot reduce cold-start latency. Adding a DLQ adds complexity and improves robustness for failures, but it leaves the p95 latency problem entirely untouched.
- A
Enable provisioned concurrency for the function.
Provisioned concurrency pre-initializes a specified number of Lambda execution environments, so requests are served by already-warmed containers instead of incurring cold-start latency. Because the traffic is predictable, you can set the provisioned level to match expected concurrent executions, which directly stabilizes p95 latency by eliminating the variability of new environment initialization. It is the only option that actively pre-warms capacity, and while it incurs cost for idle capacity, it is the correct choice for latency-sensitive predictable workloads.
- 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: Raising the Lambda timeout to 15 minutes only changes the maximum execution duration for each invocation; it does not affect how quickly execution environments are initialized or how fast the service scales out. Cold starts occur when a new environment is provisioned, and a longer timeout does nothing to pre-warm environments or reduce the time taken to load the runtime and function code. In fact, a longer timeout could adversely affect performance by allowing slow invocations to occupy resources longer, and it does not address the root cause of startup latency.
- E
Add an SQS dead-letter queue to reduce startup latency.
Why wrong: An SQS dead-letter queue (DLQ) is a reliability mechanism that captures failed event records for later debugging or replay, but it has no role in Lambda initialization or scaling. When Lambda is invoked asynchronously with an SQS source, the DLQ simply holds messages that exceeded retry limits; it does not pre-warm execution environments and cannot reduce cold-start latency. Adding a DLQ adds complexity and improves robustness for failures, but it leaves the p95 latency problem entirely untouched.