What a cold start is
A cold start is the extra latency when a serverless function runs in a fresh instance. The platform must allocate a container, load your code and runtime, and run any initialization before handling the request.
A warm start reuses an already initialized instance and skips most of that work, so it is much faster.
Why it happens
After a period of inactivity the platform shuts idle instances down to save resources. The next request then pays the startup cost. A burst of traffic can also trigger many cold starts at once as new instances spin up.
Reducing cold starts
- Smaller deployment packages less code to load.
- Lighter runtimes some languages start faster than others.
- Provisioned concurrency keep a pool of instances warm and ready.
- Minimize init work do heavy setup lazily, not at module load.
Cold starts matter most for user facing, latency sensitive APIs. For background or batch jobs the delay is usually acceptable.
Key idea
A cold start is the startup cost of initializing a fresh function instance, mitigated with smaller packages, faster runtimes, and provisioned concurrency.