A latency-sensitive API backed by Lambda shows occasional 2-3 second spikes on first requests after idle periods — cold starts. What's the most direct fix?
A.Increase the function timeout
Timeout affects max duration, not init latency.
B.Enable provisioned concurrency so initialized environments stay warm
Correct. Warm environments eliminate cold starts entirely.
C.Move the code to a larger EC2 instance
Lambda doesn't run on user-managed EC2.
D.Add more memory and a dead-letter queue
Memory speeds execution but doesn't pre-warm environments; a DLQ handles failures, not latency.
Why this answer
Provisioned concurrency keeps a set number of execution environments pre-initialized — requests are served without init latency. It's the targeted fix for cold-start spikes (alternatives: smaller package, SnapStart for Java).
Correct answer: B · Last reviewed 2026-10-26
Official AWS references
Practice this interactively
Answer without seeing the solution first in the Debugging & Optimization practice session.
Practice Debugging & Optimization