Skip to main content

AWS Lambda Cold Start Optimization

How cold starts actually work in AWS Lambda and the techniques that cut them down: runtime and memory choices, code and package tuning, provisioned concurrency, and SnapStart.

intermediate
Serverless

AWS Lambda Cold Start Optimization

How cold starts actually work in AWS Lambda and the techniques that cut them down: runtime and memory choices, code and package tuning, provisioned concurrency, and SnapStart.

18 cards
18 minutes
1 / 18
0% Known
0
? 0
Card 1 of 18
Fundamentals
Swipe left/right to navigate cards
Question

What actually happens during a Lambda cold start?

Tap to reveal
Answer

A cold start is the work Lambda does before your handler can run, when no warm environment exists: 1. Download your code (zip or container image) to a fresh micro-VM 2. Start the execution environment (a Firecracker micro-VM) 3. Bootstrap the language runtime (JVM, Node, Python, and so on) 4. Run your init code, meaning everything outside the handler Only after all that does your handler run. Steps 1 to 4 are the cold start. Lambda gives the init phase up to 10 seconds and a burst of extra CPU, so heavy init is cheaper than you might expect, but it still adds to first-request latency.

aws-lambda
cold-start
serverless
Sponsored
Carbon Ads