Free — no signup required

Warm Pools: Cheating the Boot Time

3 min read

The Latency Problem

Some applications have long initialization times. A Java Spring Boot application might take 3–5 minutes to start. A machine learning inference server loading a large model might take 8–10 minutes. If traffic spikes suddenly and the ASG triggers a scale-out event, waiting 10 minutes for a new instance to become healthy is often unacceptable.

The naive solution is to over-provision — always run more instances than you need. This works but is expensive. Warm Pools are the elegant alternative.

How Warm Pools Work

A Warm Pool is a secondary pool of EC2 instances that sit alongside your active ASG fleet. These instances have already completed their User Data scripts — dependencies are installed, models are loaded, caches are primed. They are just waiting.

When the ASG needs to scale out, instead of launching a brand-new instance (which would take 10 minutes), it promotes an instance from the Warm Pool into the active fleet. Because the instance is already initialized, it can pass health checks and serve traffic in 30–90 seconds rather than 10 minutes.

The Three Warm Pool Instance States

You choose what state Warm Pool instances sit in while waiting:

State Boot Time on Promotion Cost
Running ~30 seconds (just re-register) Full EC2 hourly rate
Stopped ~60–90 seconds (start + health check) EBS storage only (~$0.10/GB/month)
Hibernated ~30–45 seconds (resume from RAM snapshot) EBS storage + snapshot cost

Stopped is the most common choice. You pay only for the EBS volume (a few cents per day per instance), not for compute. The 60–90 second promotion time is acceptable for most workloads.

Configuring a Warm Pool

# Add a warm pool to an existing ASG
# Keep 2 instances in the warm pool, in Stopped state
aws autoscaling put-warm-pool \
  --auto-scaling-group-name "my-web-asg" \
  --pool-state "Stopped" \
  --min-size 2
# Describe the current warm pool state
aws autoscaling describe-warm-pool \
  --auto-scaling-group-name "my-web-asg"

Expected output (abbreviated):

{
  "WarmPoolConfiguration": {
    "MinSize": 2,
    "PoolState": "Stopped",
    "Status": "Active"
  },
  "Instances": [
    {
      "InstanceId": "i-0abc123def456",
      "InstanceType": "t3.micro",
      "AvailabilityZone": "us-east-1a",
      "LifecycleState": "Warmed:Stopped",
      "HealthStatus": "Healthy"
    }
  ]
}

Warm Pools and Lifecycle Hooks

Warm Pools have their own lifecycle states (Warmed:Pending, Warmed:Stopped, Warmed:Running, Warmed:Hibernated) and they integrate with Lifecycle Hooks. You can attach a hook to the warmed:pending transition to run initialization logic once when an instance first enters the Warm Pool — so that by the time it is promoted to the active fleet, all setup is already complete.

Key architectural insight: The combination of a Warm Pool with a Pending:Wait Lifecycle Hook on the active ASG gives you two-stage initialization. Stage 1 (in the Warm Pool): install dependencies, download models. Stage 2 (on promotion to active): register with service discovery, prime application-level caches. This separation keeps the Warm Pool replenishment fast while ensuring instances are fully ready before receiving traffic.

This is one of 18 chapters

Get every chapter — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

See pricing