Join us
The Amazon EBS (Amazon Elastic Block Store) is a scalable, easy-to-use block storage service.
Paired with EC2, it is designed for high-performance and transaction-intensive workloads.
It achieves this by providing volumes that are mounted as disks on EC2 instances for onward usage with frequently changing data.
These volumes are flexible helping you keep your data available, encrypted, and stored for backups.
To meet the different needs of its users, AWS makes available two major categories of EBS Volume for EC2 instances: SSD-based and HDD-based volumes. You can have a look at the major differences between the different types of volumes here and here.
Today, we will be examining two main SSD volumes:
The io2 Block Express EBS Volume
Amazon announced the general availability of the io2 Block Express EBS Volume for EC2 instances, the io2 Block Express volume allows users to get the best-performing block storage when deploying applications and databases that require the most intense I/O performance. Previously, this was not straightforward as developers had to attach multiple EBS volumes to a single instance to meet the desired throughput, IOPS, and capacity level.
Compared to the traditional io2 volumes that offer up to 64K IOPS capability, 1GB/s throughput, and single-digit millisecond latency, the io2 Block Express volume quadruples the capacity by providing up to 256,000 IOPS, 4 GB/s, and sub-millisecond latency.
The gp3 EBS Volume
The new gp3 general SSD EBS Volume for EC2 instances is an upgrade to the widely used gp2 volume. It allows users to provision storage capacity for the same workloads at a lower cost.
Like the gp2 EBS volume, gp3 has the same volume size, max throughput/instance, and max IOPS/Volume and Instance.
However, the gp3 has 4x the max throughput per volume (1 GB/s) than that of gp2 ( 250 MB/s).
With the previous gp2 volume, users had to configure a bigger storage volume if they needed a higher IOPS and throughput.
This is not the case with the pay-as-you-go format of the gp3, users don’t need to provide more capacity to increase performance and pay for only additional resources used.
With the gp3 EBS volume, users can run medium-sized databases such as Oracle, MySQL, Cassandra, and other latency-sensitive applications at lower storage costs compared to gp2.
AWS cost optimization: gp3 and io2 block express EBS Volumes
There are several factors one has to consider before choosing the best EBS volume. Whatever the choice, cost optimization — reducing cloud spending without compromising performance has to be the goal.
Cost and Performance
For applications requiring the highest performance with throughput requirements greater than 16,000 IOPS, the io2 block express volume is the obvious choice. The Max IOPS/Volume volume for the gp3 volume is 16,000 whilst the io2 block express can go as high as 256,000.
Price per provisioned IOPS per month (Performance)
$0.065 up to 32,000 IOPS
$0.046 from 32,001 to 64,000 IOPS
$0.032 > for greater than 64,000 IOPS
For companies that need moderately high performance — where the majority of AWS users fall in — the gp3 is the best EBS volume for them.
They, however, have to make sure that their applications require 16,000 IOPS or less and that the throughput volume doesn’t exceed 1000 MB/s.
Choosing the gp3 for such scenarios results in;
Migration
Amazon has made migrating from one EBS Volume to another quite easy. It can be done while in an in-use state and result in little or no downtime i.e. without detaching the volume or restarting the instance.
There are two recommended ways of performing the migration.
An existing feature of EBS, Elastic Volume enables you to change EBS volume or type without incurring an additional cost. Your costs however start rising once the newly selected volume starts running. There are however some requirements and limitations which you have to pay attention to.
For example, to migrate to a General purpose SSD volume like gp3 with Elastic Volume, follow the steps below:
2. Select the intended volume type, in this case, gp3. You can also adjust the size, IOPS, and throughput within the min-max range provided.
3. The modifications can take some time to take full effect. To monitor progress, click on the modified volume to see the current state of modification and percentage progress.
AWS CLI
You can use the AWS CLI modify-volume command to also change the volume type and size configuration.
For example, to modify a volume to gp3. You can change the existing volume type, size, and IOPS value by running the command below:
The sample output will be:
$ aws ec2 modify-volume --volume-type gp3 --iops 5000 --size 350 --volume-id vol-11111111111111111
You can monitor this modification with the describe-volumes-modifications command. Here’s a sample command:
$ aws ec2 describe-volumes-modifications --volume-ids vol-11111111111111111 vol-22222222222222222
As you can see, the migration was successful without detaching your EBS volumes or restarting your EC2 instances.
NOTE: Not all AWS instance type supports the EBS gp3 in-place migration, in these cases a snapshot and building a new volume/Ec2 instance might be the only solution.
There are other means of migrating to the gp3 volume. For example, you can automatically upgrade existing gp2 volumes to gp3 using AWS Systems Manager. The process is outlined here.
A Note About EKS
AWS Elastic Kubernetes Service has the following requirements for gp3:
{
"VolumeModification": {
"TargetSize": 350,
"TargetVolumeType": "gp3",
"ModificationState": "modifying",
"VolumeId": "vol-11111111111111111",
"TargetIops": 5000,
"StartTime": "2021-07-19T22:21:02.959Z",
"Progress": 0,
"OriginalVolumeType": "io2",
"OriginalIops": 300,
"OriginalSize": 100
}
}
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: ebs-sc-gp3
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
parameters:
csi.storage.k8s.io/fstype: xfs
type: gp3
encrypted: "true"
Summary
The Amazon Elastic Block Store (EBS) when used with EC2 can power durable, secure, performant applications with unlimited scale. AWS provides six different EBS volumes provisioned with various benchmarks. Before selecting a volume, companies have to assess their needs to make a well-balanced choice. For most companies, the best choice is the new gp3 EBS volume.
Join other developers and claim your FAUN account now!
AWS DevOps Consultancy, Boldlink
@boldlinkInfluence
Total Hits
Posts
Only registered users can post comments. Please, login or signup.