All cheat sheets
Computecheat sheet

EC2 Hibernation

A pause button that saves RAM to the root EBS volume — resume in 30–60s with warm caches and loaded models instead of a 5–10 min cold boot. Great for expensive-warm-up dev and ML instances; a tactical tool, not an architecture pattern.

Last reviewed: July 14, 2026

TL;DR: Hibernation (2017) is the laptop-lid close for EC2: it writes RAM to the root EBS volume and shuts down, then reloads memory on start so apps resume in 30–60 seconds with warm caches, loaded models, and warm DB connections — no 5–10 minute cold boot or re-initialization. You stop paying compute (still pay EBS). It shines wherever warm-up is expensive — ML training, data jobs with GB of reference data in RAM, dev environments — but it's a tactical tool with real constraints, not something to build your architecture around.

The numbers

  • While hibernated you pay EBS (root volume + RAM snapshot + attached volumes) and any Elastic IPs; you don't pay compute or data transfer.
  • Root volume must hold RAM + OS — size it to ~RAM + 10–20 GB; a 16 GB instance needs 16 GB+ free just for the snapshot.
  • Field examples: an ML researcher hibernating a p3.2xlarge ($3/hr) 14 hrs/day netted **$37/day ($740/mo)** after EBS plus 15 min saved every morning; a dev lead hibernating 15 m5.large outside business hours netted $147/week ($7,600/yr).

Do this

  1. Launch with hibernation enabled and an encrypted root volume — both are required and neither can be retrofitted onto an existing instance.
  2. Use a supported instance type + AMI (T2/T3, M5, C5, R5, Amazon Linux 2/Ubuntu/Windows, etc.) — check before assuming.
  3. Hibernate instead of stop from console/CLI (automation must pass --hibernate to stop-instances, or you'll just do a normal stop and lose the state).
  4. Use an Elastic IP or rely on private IPs + VPC endpoints — a plain public IP changes on resume and breaks hardcoded references/DNS/firewall rules.
  5. Run the math against simple stop/start — if boot time isn't painful, plain stop is simpler and you skip the RAM-snapshot storage.

Gotchas

  • 60-day maximum — after that the instance just stops and the RAM snapshot is lost; not a "forget it for months" tool.
  • EBS storage keeps billing while hibernated — the savings are compute-only, so short idle windows may not beat plain stop.
  • Doesn't play with Auto Scaling Groups — it's for long-lived instances, not dynamic fleets.
  • Combining with Spot is a calculated risk — a Spot interruption loses the hibernation state entirely; fine for interruptible work, not critical jobs.

Skip this if

  • The instance is stateless and boots fast, ephemeral, or ASG-managed — hibernation adds complexity for little benefit; a simple stop/start (or EC2 Instance Scheduling) is the right lever.
  • You mainly want off-hours savings on predictable schedules — EC2 Instance Scheduling handles that without the encryption/type constraints; pair hibernation with Spot Instances only for interruptible ML work.

Run this audit with your AI assistant

Paste this into Claude, ChatGPT, or any agent that can run the AWS CLI with read-only credentials. It audits your account for exactly the waste this sheet describes — and changes nothing.

You are auditing an AWS account for EC2 Hibernation opportunities (and
misuse). Use the AWS CLI with READ-ONLY credentials. Do not create,
modify, or delete anything — report findings and recommended (unapplied)
fixes only.

1. Candidates: aws ec2 describe-instances — flag long-lived, non-ASG
   instances with expensive warm-up (ML with big in-memory models/
   datasets, dev envs, scheduled analytics) that idle on a predictable
   schedule. Confirm HibernationOptions.Configured and encrypted root
   volume (both required; can't retrofit).
2. Cost model: for each, compute compute saved while hibernated vs
   continued EBS cost (root volume must hold RAM + OS; ~RAM+10-20 GB).
   Note EBS + EIP still bill while hibernated.
3. Anti-patterns: flag stateless/fast-boot instances (simple stop/start
   is simpler/cheaper) and any ASG-managed instances (hibernation doesn't
   fit dynamic scaling).
4. Constraints: 60-day max hibernation, supported instance types/AMIs,
   public IP changes on resume (recommend Elastic IP / private + VPCe).

Report a table: instance | warm-up cost | hibernate fit? | est. $/mo net
saved | blockers (encryption/type/ASG). Change nothing.
Works with any assistant that can run shell commands.

Want the guided version?

The EC2 Hibernation walkthrough covers this topic interactively — it asks about your setup, branches to what’s relevant, and quizzes you on the tricky parts. Free and anonymous.

Start the walkthrough