AWS EBS is a resource that can create storage and attach them to instances as volumes for boot purposes and data storage. EBS can be formatted in a default file system and can be mounted to Linux instances and will be available for data storage as transparent resources.
The main idea behind EBS is it presents itself as a block on memory that can be formatted and mounted to any AWS EC2 Instance.
The speed and performance of EBS depend on the underlying type.
- SSD Drives ( major use as boot devices ) throughput in IOPS.
- HDD Drives (other loads ) throughput is measured in MB/s.
Bear in mind that EC2 instances have limits on how much total IOPS capacity you can consume meaning a virtual bottleneck may be formed at the EC2 instance, not the memory.
If you require high IOPS workloads for applications such as databases or analytics tools, then you should use SSD volumes whenever possible, if not then standard magnetic drives will suffice for most other workloads.
Check out our EBS Cost Calculator.
Basic Info on EBS Storage
EBS volumes are also capable of bursting up to 3.9 GB/s and down to 1.6 GB/s for sustained I/O operations, which is a significant improvement over previous generations of Amazon EC2 instances. The burst speed is only available when accessing the volume from a local instance or EBS-backed AMI, but it enables you to perform large read or write operations at a much faster rate than the base speed supported by the underlying hardware.
Below is a snapshot of the SSH session command to an EBS-backed instance.
The instance used is Amazon Linux 2.
As can be seen, the attached volume is a 16G EBS block. There are two partitions.
[ec2-user@ip—– ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:0 0 16G 0 disk
├─nvme0n1p1 259:1 0 16G 0 part /
└─nvme0n1p128 259:2 0 1M 0 part
Taking information on partition
[ec2-user@ip——— ~]$ sudo file -s /dev/nvme0n1p1
/dev/nvme0n1p1: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)
Types of EBS Applications or Use Cases
- EBS-backed instances
- EBS Snapshots
- Amazon Elastic Block Store (EBS) Volumes
EBS-backed instances are the most common type of instance. They run from Amazon’s EC2 service and use EBS volumes as their primary storage. EBS snapshots are point-in-time copies of your data that can be used to create a new AMI (Amazon Machine Image) or restore your original instance to its previous state if it fails.
EBS snapshots can be created manually or using a schedule. they are an instantaneous backup of the EBS volume which can be later used to resurrect the instance should the need arise.
Moreover, when an AMI is created, it would also create a linked snapshot which can add to your running costs.
EBS is linked to EC2 instances
EBS is linked to EC2 instances. In other words, you can’t use EBS without an EC2 instance. This means that the EBS volume will be attached to your EC2 instance and will only be accessible from within that particular EC2 instance.
The relationship between your EC2 instance and its EBS volumes isn’t like a real-world hard drive or SSD where you can detach the storage and move it elsewhere.
EBS blocks are persistent storage blocks permanently attached to the instance as the volumes.
Even when the EC2 instance is shut down the attached EBS volume still persists to it and is charged to you.
You can’t detach an EBS volume from an EC2 instance unless you (shutdown and)terminate the instance first
EBS versus EFS Storage
EBS volumes provide faster performance than EFS and are more durable as they are stored in multiple availability zones that can survive an outage of an individual zone. However, they also cost more than EFS storage. You can use the EC2 instance with an EFS volume to access data that is accessed frequently. Depending on your needs, you might want to think about using both types of volumes in the same instance. For example, if you have a website or application that uses media files like images or video clips, you could place those files on an EFS volume
One exception is storing MySQL database files. Placing MySQL Database files will render your DB server performance significantly reduced hence EBS is more suitable for DB application storage.
Applications of EBS
Amazon EBS provides the ability to store data in the cloud and has been used for a range of applications
- Database servers
- File servers
- Virtual desktops
In addition to these applications, EBS can also be used for general-purpose computing storage as big data analytics clusters.
Charges for EBS Volumes and Snapshots
EBS blocks are charged in two main categories. In both categories, you shall be billed for GB-MONTH units where 1 GB-Month is the cost of retaining 1 GB EBS for one month or 2 GB EBS for ½ month.
1) EBS Volumes:
- Are charged per GB per month. These are volumes persistently attached to your instances and will be billed accordingly. The charge is independent of the state of the instance. As long as instance exist you shall be billed. The charge varies from 0.1 USD GB-MONTH to 0.125 USD GB-MONTH.
2) EBS Snapshots:
- Regardless of the creation method, manually or automatically, Snapshots are billed hourly at $0.05 per GB-MONTH.
How is EBS billed?
The way that EBS is billed is slightly different from the way that EC2 instances are charged. With EC2 instances, you pay for each hour of instance usage based on the region and type of instance that you’re running. With EBS volumes or EBS snapshots, your bill will be based on the amount of storage used multiplied by the number of months that it’s saved over.
To get a quick estimation of your personal EBS Storage costs, Check out our EBS Cost Calculator.
A simple example:
If you are retaining one instance using 8 GB EBS volume and for three months, then you’ll be billed
8 GB * 3 Months = 24GB-months * 0.1 GB-Months = 2.4 USD for 3 months
With a slightly more realistic example
3 instances total with 2 Shutdowns and 1 running – each using 16 GB volumes.
For one month => 3 * 16 = 48 * 0.1 GB-Month => 4.8 USD / Month
18 snapshots total – each 16 GB => 288 * 0.05 GB-Month => 14.4 USD/Month
Total Cost for EBS = 19.2 USD/Month
Tips for Reducing EBS costs
- Only keep the instances you need, terminate others
- Do a check on snapshots and delete the ones which are redundant.
- Delete redundant AMIs, and when you do very important to note that the associated snapshot does not get automatically deleted, hence take note of it and delete it manually.
We have discussed some concepts regarding EBS volumes and snapshots and shed some light on the EBS billing methodology used by AWS.