Scalingcold startsprovisioned concurrencywarm startminimum instances

Cold start

Definition

A cold start is the time spent creating a fresh execution environment (fetching code, starting the runtime and running initialisation) before an instance can serve its first request; later requests on the same warm instance skip it.

In practice

Serverless platforms create instances on demand, so bursts, deploys and scale from zero all produce cold starts, ranging from tens of milliseconds for small functions to several seconds for large runtimes or packages that open database connections at start-up. They show up in tail latency rather than the median.

Mitigations are smaller packages, lazy initialisation, faster runtimes, snapshot-based start-up where offered, and paid pre-warmed capacity such as provisioned concurrency or minimum instances, which trades away scale-to-zero cost savings. Containers and autoscaled VMs have the same problem on a longer timescale, which is why warm-up and slow start exist.

Example

A Java function answers warm requests in 40 ms but takes 2.5 s on a cold start; setting provisioned concurrency to 20 keeps the morning traffic ramp on warm instances.