Cold Start
A cold start is the initialization latency when a serverless function spins up a fresh environment, impacting tail latency for idle or bursty workloads.
A cold start is the extra delay that occurs when a serverless platform must create a new execution environment to handle a request. Before the function code can run, the platform allocates resources, downloads the code, starts the runtime, and runs any initialization. A warm start, by contrast, reuses an environment that is already running, so it responds much faster.
How It Works
Serverless platforms keep some function instances warm after use, but they shut idle instances down to save resources. When a request arrives and no warm instance is available, the platform performs a cold start. The penalty depends on the language runtime, the size of the deployment package and dependencies, virtual private cloud attachment, and the memory allocated. Interpreted runtimes with light dependencies start fastest; large packages and heavy frameworks start slower. Concurrency spikes also trigger cold starts because new instances must be created to meet demand.
Why It Matters
Cold starts affect tail latency and user experience, especially for low-traffic functions that idle between requests and for sudden bursts that require many new instances. For latency-sensitive APIs, cold starts can be unacceptable. Teams mitigate them by keeping packages small, trimming dependencies, choosing faster runtimes, using provisioned concurrency to keep instances warm, and sending periodic warm-up requests. The trade-off is that warm capacity costs money even when idle, partly offsetting the pay-per-use benefit of serverless.
Related Terms
Cold start is a property of serverless and function-as-a-service platforms, interacts with autoscaling, and is a key performance consideration.