EC2 instances in an Auto Scaling warm pool aren’t actually running until they’re needed; they’re in a suspended state, saving you money while staying ready.

Let’s see this in action. Imagine you’ve got a web application that experiences sudden traffic spikes. You configure an Auto Scaling group with a warm pool.

{
  "AutoScalingGroupName": "my-web-app-asg",
  "MinSize": 1,
  "MaxSize": 5,
  "DesiredCapacity": 1,
  "LaunchTemplate": {
    "LaunchTemplateName": "my-web-app-launch-template",
    "Version": "$Latest"
  },
  "WarmPoolConfiguration": {
    "MinSize": 2,
    "MaxInstanceLifetime": 3600,
    "PoolState": "Hibernation"
  }
}

Here, MinSize for the ASG is 1, meaning at least one instance is always in the running state. However, MinSize within WarmPoolConfiguration is 2. This tells Auto Scaling to keep two instances in the warm pool, ready to be launched. PoolState: "Hibernation" means these instances will be in a hibernated state, not fully running, to conserve costs. MaxInstanceLifetime of 3600 seconds (1 hour) ensures instances are recycled periodically.

When traffic surges, Auto Scaling detects the need for more capacity. It doesn’t launch a brand new instance from scratch. Instead, it takes one of the hibernating instances from the warm pool, wakes it up, and attaches it to the load balancer. This "warm" instance is already in a near-ready state, having passed its initial boot-up and configuration. The whole process takes seconds, not minutes, compared to a cold launch.

The problem this solves is the trade-off between cost and responsiveness. Traditional Auto Scaling groups either keep instances running all the time (expensive) or launch new ones on demand (slow to respond to sudden load). Warm pools offer a middle ground: instances are kept in a low-cost, suspended state, but are ready to be activated much faster than a cold start.

Internally, when an instance is in the warm pool in a Hibernation state, its memory state is saved to an EBS snapshot. When Auto Scaling needs to use it, the instance is launched using this snapshot, effectively resuming from where it left off. This is distinct from Stopped state, where the instance is powered off and its memory is lost. For Stopped state, the instance needs to boot up entirely, install software, and run configurations, which takes significantly longer.

The exact levers you control are primarily within the WarmPoolConfiguration:

  • MinSize: The minimum number of instances to keep in the warm pool. This dictates your baseline readiness.
  • MaxInstanceLifetime: How long an instance can remain in the warm pool before being terminated and replaced. This helps prevent stale instances and ensures you’re leveraging newer AMIs or configurations.
  • PoolState: This can be Stopped or Hibernation. Hibernation saves memory state for faster resumes, while Stopped is a simpler powered-off state. Hibernation requires specific instance types and EBS volume configurations.

When an instance is in the Hibernation state within the warm pool, its entire memory content is saved to an EBS volume. Upon activation, the instance resumes from that exact memory state, rather than performing a full boot. This is the key to its speed advantage over a Stopped state warm pool or a cold launch.

The next challenge you’ll likely encounter is managing the lifecycle of instances within the warm pool, especially when dealing with application updates or security patching.

Want structured learning?

Take the full Ec2 course →