Sub topic 3
Choosing a volume type
This chapter assumes you know what an EBS volume is, what an Availability Zone is, and how to run basic AWS CLI commands. Here you will learn how the six EBS volume types differ and how to pick one for a workload.
Two families
EBS volumes fall into two families:
- SSD-backed volumes (gp3, gp2, io2, io1) are tuned for IOPS, the number of small read and write operations per second. Use them for boot volumes, databases, and other random-access workloads.
- HDD-backed volumes (st1, sc1) are tuned for throughput, the megabytes per second of large sequential reads and writes. Use them for logs, data warehouses, and large streaming jobs. They cannot be boot volumes.
Comparing the types
| Type | Family | Performance | Typical use |
|---|---|---|---|
| gp3 | General purpose SSD | 3,000 IOPS and 125 MiB/s baseline, up to 16,000 IOPS and 1,000 MiB/s | Default choice |
| gp2 | General purpose SSD | 3 IOPS per GiB, up to 16,000 IOPS | Older volumes |
| io2 | Provisioned IOPS SSD | Up to 64,000 IOPS (256,000 on Block Express) | Critical databases |
| io1 | Provisioned IOPS SSD | Up to 64,000 IOPS | Older high-IOPS volumes |
| st1 | Throughput-optimized HDD | Up to 500 MiB/s | Big data, logs |
| sc1 | Cold HDD | Up to 250 MiB/s | Infrequently accessed data |
These limits change over time, so check the current EBS documentation before you commit to a design.
gp3 versus gp2
With gp2, performance depends on size. A small volume gets few IOPS, and volumes under 1,000 GiB rely on burst credits to reach 3,000 IOPS. Teams often over-sized gp2 volumes just to get more IOPS.
With gp3, IOPS and throughput are independent of size. Every volume starts at 3,000 IOPS and 125 MiB/s, and you pay extra only for what you add above that. gp3 is also cheaper per GiB than gp2. For new volumes, start with gp3.
When to move beyond gp3
Choose io2 when you need more than 16,000 IOPS, consistently low latency, or higher durability. io2 is designed for 99.999% durability, compared with 99.8% to 99.9% for the other types. It costs more, because you pay for provisioned IOPS. Choose io1 only when you must stay compatible with an existing setup.
Choose st1 for large sequential workloads where throughput matters more than IOPS. Choose sc1 when cost matters most and access is rare.
Creating a volume with explicit performance
Setting IOPS and throughput explicitly makes the performance visible in your scripts and templates:
aws ec2 create-volume \
--availability-zone us-east-1a \
--volume-type gp3 \
--size 100 \
--iops 3000 \
--throughput 125 \
--encrypted \
--tag-specifications 'ResourceType=volume,Tags=[{Key=Name,Value=data-vol}]'Common mistakes
- Choosing a volume type but ignoring instance limits. An instance can cap total EBS performance below what the volume offers.
- Using an HDD type for a boot volume or a random-access database.
- Paying for io2 when a gp3 volume with raised IOPS would do.
- Leaving old gp2 volumes in place. You can switch them to gp3 later with Elastic Volumes.
Exercise
A database needs 25,000 IOPS with low latency and the highest durability AWS offers for EBS. Which volume type fits, and why not gp3?
Show answer
io2. gp3 tops out at 16,000 IOPS, which is below the requirement. io2 supports tens of thousands of provisioned IOPS and is designed for 99.999% durability.