Inferensys

Glossary

Cold Start

Cold start is the initial latency incurred when a user request triggers the provisioning and initialization of a new compute instance, such as loading a large language model into GPU memory.
ML engineer running AI model benchmarks, performance charts on multiple screens, late night home office setup.
COST AND RESOURCE MANAGEMENT

What is Cold Start?

Cold start is a critical performance and cost factor in serverless and containerized deployments of machine learning models, particularly large language models.

Cold start is the initial latency penalty incurred when a user request triggers the provisioning and initialization of a new, idle compute instance (e.g., a container or serverless function). For LLMs, this process involves loading the model weights from storage into GPU memory, which can take from several seconds to minutes, resulting in a significantly slower first response compared to subsequent requests on a warm instance that is already loaded and ready.

This latency directly impacts user experience and drives infrastructure costs, as providers often bill for the entire initialization duration. Mitigation strategies include provisioned concurrency, predictive scaling, and model optimization techniques like quantization to reduce load times. In cost-sensitive deployments, managing cold starts is essential for balancing responsiveness with efficient resource utilization.

COST AND RESOURCE MANAGEMENT

Key Causes and Components of Cold Start

Cold start latency is not a single failure but the emergent result of specific infrastructure behaviors and resource management policies. Understanding its root causes is essential for effective mitigation.

01

Compute Instance Initialization

The primary source of latency is the time required to provision and boot a new compute instance (virtual machine or container) from a stopped or non-existent state. This process involves:

  • Image Pulling: Downloading the container image or VM snapshot containing the model binaries, dependencies, and serving runtime.
  • Resource Allocation: The cloud provider's scheduler must locate and assign physical hardware (e.g., a specific GPU).
  • OS and Runtime Boot: The guest operating system and application runtime (e.g., Python, CUDA drivers) must initialize before the model can load. This initialization can take from several seconds to over a minute, depending on image size and provider.
02

Model Loading into GPU Memory

After the instance is ready, the model's parameters must be transferred from persistent storage (e.g., network-attached disk) into the GPU's high-bandwidth memory (VRAM). This is a major bottleneck.

  • I/O Bound Transfer: Loading a multi-gigabyte model file over a network is slow compared to in-memory computation.
  • VRAM Allocation: The GPU driver must allocate contiguous memory blocks for the model weights, which can be a complex operation for large models.
  • Weight Initialization: Some frameworks perform additional setup, converting weights to the optimal layout for the specific GPU architecture. For a 70B parameter model in FP16, this can involve moving over 140 GB of data.
03

Stateless Autoscaling Policies

Modern cloud-native deployments often use horizontal pod autoscalers (Kubernetes) or similar mechanisms that scale the number of serving replicas to zero during periods of no traffic to save costs. When a new request arrives, the orchestrator must:

  1. Detect the need for a new replica.
  2. Schedule it on an available node (which may itself need scaling).
  3. Wait for the full cold start sequence to complete. While cost-effective, this policy directly trades off savings for guaranteed latency spikes on the first request after an idle period.
04

Containerization and Orchestration Overhead

The abstraction layers that enable portability and scalability introduce inherent latency. Key contributors include:

  • Container Runtime Startup: Engines like containerd or docker must create namespaces, cgroups, and mount filesystems.
  • Sidecar Containers: In service meshes (e.g., Istio), a request cannot be routed until the proxy sidecar container is fully initialized.
  • Readiness Probes: The orchestrator will not send traffic to a pod until its health checks pass, which typically requires the model server to be fully loaded and listening. This adds verification time to the critical path.
05

Warm vs. Cold Instance Dichotomy

The performance gap that defines the cold start problem. Key differences:

Cold InstanceWarm Instance
Model weights on disk/networkModel weights in GPU VRAM
CUDA context not establishedCUDA context active, kernels compiled
No pre-allocated KV cache slotsKV cache memory pre-allocated and ready
First request pays full initialization costSubsequent requests benefit from cached state
This dichotomy is why the first token latency (time to first byte) is disproportionately high compared to the inter-token latency (time between subsequent tokens).
06

Impact on Tail Latency (P99)

Cold starts are a primary driver of poor tail latency metrics (P95, P99). While most requests hit warm instances and are fast, a small percentage that trigger new instance creation experience orders-of-magnitude higher latency.

  • Sporadic Traffic Patterns: Applications with bursty or unpredictable traffic suffer most, as instances scale down during lulls.
  • User Experience Degradation: For interactive applications like chatbots, a 20-second cold start is catastrophic for user retention. Mitigation strategies like predictive scaling or maintaining a warm pool of instances directly target improving these worst-case latency percentiles.
COLD START

Impact on Performance and Cost

Cold start latency directly impacts user experience and operational expenditure in serverless and containerized LLM deployments.

A cold start is the initial latency penalty incurred when a user request triggers the provisioning and initialization of a new, idle compute instance. This involves loading the LLM weights into GPU memory, starting the container, and initializing the serving runtime, causing the first response to be orders of magnitude slower than subsequent requests on a warm instance. This delay directly degrades user-perceived performance and is a critical metric for service level agreements.

From a cost perspective, cold starts create inefficiency. Providers often bill for the full lifecycle of an instance, including initialization time where no productive work is done. Frequent scaling events due to variable traffic can multiply these idle costs. Mitigation strategies like provisioned concurrency, predictive autoscaling, and keeping a pool of warm instances trade off higher baseline cost against guaranteed low latency, requiring careful FinOps analysis to optimize the performance-cost balance.

TECHNIQUE COMPARISON

Cold Start Mitigation Strategies

A comparison of engineering strategies to reduce or eliminate the latency penalty incurred when initializing a new compute instance for an LLM inference request.

StrategyPre-WarmingKeep-Alive PoolsPredictive ScalingModel Optimization

Core Mechanism

Proactively initializes instances before requests arrive

Maintains a pool of idle, warm instances

Uses historical patterns to forecast demand

Reduces model load time and memory footprint

Primary Latency Reduction

Eliminates cold start for initial requests

Minimizes cold start probability

Reduces frequency of cold starts

Decreases cold start duration

Implementation Overhead

Medium (requires scheduling logic)

High (requires pool management logic)

High (requires accurate forecasting models)

High (requires model re-engineering)

Resource Efficiency

Low (pays for idle compute)

Low to Medium (pays for idle pool)

Medium (scales ahead of demand)

High (intrinsic improvement)

Best For

Predictable traffic spikes (e.g., 9 AM surge)

Steady, high-priority traffic with strict latency SLAs

Workloads with strong daily/weekly cyclical patterns

All deployments, especially where other strategies are costly

Typical Cold Start Reduction

100% for pre-warmed capacity

95% when pool is sized correctly

50-80% depending on forecast accuracy

30-70% depending on technique

Key Metric Impact

Increases cost per request

Increases baseline infrastructure cost

Improves overall resource utilization

Improves tokens per second (TPS) on all instances

Related Techniques

Scheduled scaling

Connection pooling, Graceful shutdown

Autoscaling with custom metrics

Quantization, Model distillation, Optimized serialization

COLD START

Frequently Asked Questions

Cold start is a critical performance and cost factor in LLM serving. These questions address its causes, impacts, and mitigation strategies for engineering leaders.

A cold start is the initial latency penalty incurred when a user request triggers the provisioning and initialization of a new, idle compute instance (e.g., a container or virtual machine) to serve a large language model, which involves loading the model weights from storage into GPU memory. This process results in a significantly slower first response—often taking several seconds to minutes—compared to subsequent requests served by the now 'warm' instance with the model already loaded and ready. It is a fundamental challenge in serverless and autoscaling deployments where instances scale to zero during periods of inactivity to save costs.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.