How I Reduced My AWS Monthly Costs: Migrating EBS Volumes from gp2 to gp3
A step-by-step guide to cutting AWS storage costs by up to 20% without sacrificing performance.
By Ali Bashir · AWS · Jun 11, 2023 · 4 min read
As a DevOps engineer, optimizing costs is a crucial aspect of managing cloud infrastructure. In my journey to reduce monthly AWS costs, I discovered a significant opportunity by migrating Amazon EBS volumes from gp2 to the gp3 volume type - cutting costs while maintaining high performance and reliability.
Understanding gp2 vs gp3 EBS Volumes
Amazon EBS provides block-level storage volumes for EC2 instances. The gp2 (general-purpose SSD) volume type offers a balance between price and performance, but its IOPS are tied to its size. Amazon introduced gp3 - the next-generation general-purpose SSD - which provides better baseline performance at a lower cost.
Why Migrate from gp2 to gp3?
Lower Cost per GB: gp3 offers a lower cost per gigabyte compared to gp2 volumes - up to 20% savings.
Predictable Performance: every gp3 volume gets a baseline of 3,000 IOPS and 125 MiB/s regardless of size, with no burst credits to run out. A small gp2 volume only gets 3 IOPS per GiB and relies on bursting.
Flexibility: with gp3 you can provision IOPS and throughput independently of size, well beyond the 3,000 IOPS / 125 MiB/s baseline, and pay only for what you add.
Step-by-Step Migration Guide
Step 1 - Evaluate Your Existing Volumes
Assess your existing EBS volumes and identify those using gp2. Determine the size, performance requirements, and associated costs for each.
aws ec2 describe-volumes --filters Name=volume-type,Values=gp2 \
--query 'Volumes[].{ID:VolumeId,SizeGiB:Size,IOPS:Iops}' --output table
Step 2 - Review Performance Metrics
Use Amazon CloudWatch to analyze the performance metrics of your gp2 volumes (VolumeReadOps, VolumeWriteOps, VolumeQueueLength and BurstBalance). Look for bottlenecks or volumes that regularly run out of burst credits.
Step 3 - Size gp3 IOPS for large volumes
A gp2 volume's baseline is 3 IOPS per GiB, so any gp2 volume over 1 TiB gets more than 3,000 IOPS (a 2 TiB volume has a 6,000 IOPS baseline). For those volumes, set the gp3 IOPS to match the old gp2 baseline so performance doesn't drop. Large gp2 volumes can also reach 250 MiB/s, so raise gp3 throughput if your metrics show you need more than 125 MiB/s.
Step 4 - Modify the volume in place
gp2 to gp3 is an online Elastic Volumes change: no snapshot, no copy, no detaching and no downtime. The volume stays attached and in use while it converts.
aws ec2 modify-volume --volume-id vol-0123456789abcdef0 --volume-type gp3
# Over 1 TiB: keep the old gp2 baseline (here a 2 TiB volume = 6,000 IOPS)
aws ec2 modify-volume --volume-id vol-0123456789abcdef0 --volume-type gp3 --iops 6000 --throughput 250
Step 5 - Watch the modification
Track progress until the state moves from modifying to optimizing and then completed. Once it is optimizing the volume is already gp3 and EBS finishes in the background; performance can sit between the old and new settings until it reaches completed. After a modification you have to wait six hours before changing the same volume again, so get the IOPS right the first time.
aws ec2 describe-volumes-modifications --volume-ids vol-0123456789abcdef0 \
--query 'VolumesModifications[].{State:ModificationState,Progress:Progress}'
Step 6 - Validate
Watch the CloudWatch metrics (VolumeReadOps, VolumeWriteOps, latency) for a few days to confirm the volumes meet expectations.
Step 7 - Make gp3 the default
Update launch templates, Terraform modules and AMI block device mappings to gp3 so new volumes don't come back as gp2.
Conclusion
Migrating from gp2 to gp3 EBS volumes is one of the most cost-effective optimizations available to AWS teams - up to 20% lower storage cost per GB, done in place with no downtime, and no performance loss if you match the gp2 baseline IOPS on large volumes. It's a low-risk, high-reward change that every DevOps engineer should have on their checklist.