A CPU-bound Lambda function is too slow. Memory is set to 512 MB. What's the cheapest way to reduce execution time?
A.Increase the timeout
Timeout extends the ceiling, not the speed.
B.Increase memory — CPU and network scale proportionally with memory allocation
Correct. Memory ∝ CPU allocation in Lambda.
C.Enable provisioned concurrency
Provisioned concurrency kills cold starts, not execution speed.
D.Move the function into a VPC
VPC adds cold-start latency, doesn't help CPU.
Why this answer
Lambda allocates CPU linearly with memory (~1 vCPU at 1,769 MB). For CPU-bound work, raising memory often cuts duration enough to cost the same or less while finishing faster — the standard optimization lever. Timeout doesn't speed anything up.
Correct answer: B · Last reviewed 2026-11-03
Official AWS references
Practice this interactively
Answer without seeing the solution first in the Debugging & Optimization practice session.
Practice Debugging & Optimization