Which is better, gp2 or gp3 EBS volume types?
AWS announced the new SSD storage type, gp3, At AWS re:Invent 2020. It is the next generation of General Purposed block storage in AWS.
This post compares both types in terms of pricing and performance.
AWS measures the volumes performance in two dimensions:
- IOPS: the maximum number of Input and Output requests the volume can serve per second.
- Throughput: the maximum amount of data that can be read/written per second.
With gp2 volumes, you don't have direct control on the IOPs and throughput, they depend on the volume size. To get higher performance you have to use a bigger volume size.
gp3 removed this limitation and you can increase the IOPs and/or throughput independently up to 16,000 IOPs and 1,000 MiB/s respectively.
Please note that gp3 volume size, IOPs and throughput still impact each other. The maximum throughput that can be reached = (maximum IOPs) x (average IO size). Also, the maximum IOPs = (500) x (provisioned GiB). So, 32 GiB or smaller volumes can't reach the 16,000 IOPs limit.
As of December 2020, in us-east-1 region, gp2 price is only based on the total provisioned storage, $0.10 per GB-month. gp3 volumes are priced as following:
- Provisioned storage: $0.08/GB-month
- Provisioned IOPS: a gp3 volume provides a baseline 3000 IOPS (IOs per second) free of charge. You can increase the allowed IOPs for your volume up to 16,000 and will be charged $0.005/IOPS-month for the extra.
- Provisioned throughput: also a gp3 volume provides a baseline 125 MiB/s throughput free of charge. This can be increased up to $0.04/MB/s-month for provisioned throughput above the baseline.
As the variables that control the performance and pricing of the two volume types are different and I splitter my comparison into the following two scenarios:
- Default performance
We are keeping the performance of the volumes at the base default values. And we'll compare the performance for different volume sizes.
The costs in this case are proportional to the provisioned volumes sizes, $0.10 per GB-month for gp2 volumes vs $0.08/GB-month for gp3. So gp3 is 20% cheaper for all sizes.
Gp2 volumes performance depends on the volume size. As shown in the following diagram, the gp2 volume maximum IOPs can be anywhere within the thick orange line, the same applies for the maximum throughput (the blue line). On the other hand, the gp3 performance is consistent.
The graph shows that gp3 provides a higher consistent IOPS for volumes smaller than 800 GiB. But gp2 provides much higher performance for bigger volumes. Except for small volumes, gp2 allows a much higher throughput.
2. Same cost
Now let's compare the performance if we are willing to invest the 20% cost difference in increasing gp3 performance.
I gradually increased the provisioned IOPs of the gp3 volume to match the burst gp2 IOPs till it reached the limit of 16,000 IOPs at size 5.3 TiB. In parallel I increased the provisioned throughput using the remaining cost different till the gp3 volume reached the limit of 1,000 MiB/s. After that I couldn't maintain the cost differences to be zero.
The gp3 volume reached its maximum provisioned capacity and performance with a cost of 1,380$/month, while the gp2 volume had cost of 1,600$/month.
This shows that the gp3 volume had near or much better performance compared to gp2 at the same price.
gp3 is superior to gp2 and provides a better performance at or below the cost of gp2.