Skip to Content

Instance store

Disks physically attached to the EC2 host, with very high IOPS, that lose their data when the instance stops.

What it is

EBS volumes are network drives: good, but limited by the network. When a high-performance local disk is needed, some instance types come with an instance store: SSD (usually NVMe) disks physically attached to the host computer the instance runs on.

  • Much better I/O performance: millions of IOPS on the largest storage optimized types, with very low latency.
  • Included in the instance price; there's no per-GB charge.
  • Ephemeral: the data is lost when the instance stops, hibernates or terminates, or if the underlying disk or host fails. It survives a reboot.

Only some types have instance store. They usually have a d in the name (c6gd, m6id) or are storage optimized (i4i, i7i, d3). The size is fixed by the type.

How it compares with EBS

Instance store disks sit inside the host next to the instance, fastest but lost on stop; an EBS volume is reached over the network and survives stops Instance store disks sit inside the host next to the instance, fastest but lost on stop; an EBS volume is reached over the network and survives stops

Local and fast, or networked and durable.
  • Instance store lives inside the physical host. When the instance stops, it moves to other hardware and its old local disks are wiped, which is why the data doesn't follow it.
  • EBS lives on separate storage servers in the AZ. The instance reaches it over the network, so it can move with the instance, be detached, and be snapshotted.

When to use it

Instance store is good for data that can be lost or rebuilt:

  • buffers, caches, scratch data and temporary files;
  • data that's replicated across several instances anyway, such as a distributed database (Cassandra, Kafka) or a pool of load-balanced web servers;
  • very high-IOPS work that EBS can't reach.

Backups and replication are the customer's responsibility. There are no snapshots for instance store.

Exam tips

  • "Highest possible IOPS", "very low latency local storage" → instance store (storage optimized types).
  • "Temporary data, cache, buffer, scratch space" → instance store.
  • "Data must survive stop/start" → EBS, not instance store.

Common traps

  • "Instance store data survives a stop if you start the instance again." It doesn't; only a reboot keeps it.
  • "Snapshot the instance store." Snapshots are for EBS; the data has to be copied elsewhere manually.
  • "Any instance type can add instance store." Only types that come with it.

Hands-on lab: watch instance store data disappear

Goal: write to an instance store disk, stop and start the instance, and see the data gone.

Costs money

c6gd.medium (Graviton, with a 59 GB NVMe instance store) costs about $0.04 an hour On-Demand in us-east-1, plus $0.005 for its public IP. Under ten cents for the lab.

Launch an instance with instance store

Launch saa-store: Amazon Linux 2023 (64-bit Arm), type c6gd.medium, key pair saa-lab-key, tag Project=saa-lab. (If it isn't offered in your AZ, try another subnet or m6gd.medium.)

Find and use the local disk

Connect with EC2 Instance Connect:

lsblk                                   # nvme1n1, ~55G, no mount: the instance store
sudo mkfs -t xfs /dev/nvme1n1
sudo mkdir /scratch && sudo mount /dev/nvme1n1 /scratch
echo "temporary data" | sudo tee /scratch/file.txt

Reboot

Reboot from the console, reconnect, and mount it again with sudo mount /dev/nvme1n1 /scratch. cat /scratch/file.txt still works: a reboot keeps the data.

Stop and start

Stop the instance, start it, reconnect, and run lsblk. The disk is there but empty, with no file system: sudo mount /dev/nvme1n1 /scratch fails. The data is gone.

Expected result: instance store data survives a reboot but not a stop and start.

Clean up: terminate saa-store.

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt