AWS Series — What is EC2 Hibernation?
We have learned so far is we can stop and terminate EC2 instances. If we stop the instance, the data is kept on the disk ( with EBS) and will remain on the disk until the EC2 instance is started. If the instance is terminated, then by default the root device volume will also be terminated.
What happens when we start our EC2 instance?
- Operating system boots up
- User data script is run which is nothing but bootstrap scripts
- Application Start
What happens when EC2 instance hibernates?
When you hibernate an EC2 instance, the operating system is told to perform hibernation (suspend-to-disk). Hibernation saves the contents from the instance memory (RAM) to your Amazon EBS root volume. We persist the instance’s Amazon EBS root volume and any attached amazon EBS data volumes.

When you start your instance out of hibernation:
- The Amazon EBS root volume is restored to its previous state.
- The RAM contents are reloaded.
- The processes that were previously running on the instance are resumed.
- Previously attached data volumes are reattached and the instance retains its instance ID.
With EC2 hibernation, the instance boots much faster. The operating system does not need to reboot because the in-memory state (RAM) is preserved. This is useful for — Long running processes, Services that takes time to initialize.
Points to remember about EC2 Hibernation —
- EC2 Hibernation preserves the in-memory RAM on persistent storage (EBS).
- Much faster to boot up because you do not need to reload the operating system
- Instance RAM must be less than 150 GB
- Instance families include instances in General Purpose, Compute, Memory and Storage Optimized groups
- Available for Windows, amazon Linux 2 AMI and Ubuntu
- Instances can’t be hibernated for more than 60 days
- Available for On-Demand instances and Reserved instances.