EBS Volumes & Snapshots – Best Practices for Cost Optimization

In the ever-changing landscape of cloud infrastructure and virtual machines, Amazon Elastic Block Storage (EBS) is one of the most commonly used services. It provides block-level storage and is utilized with EC2 instances.
The purpose of the EBS volumes is to build a file system on top of them and use them similarly to a hard drive or other block device. In addition, a volume’s configuration, which is attached to an instance, may be changed dynamically.

However, its versatility comes with potential hidden costs, often unknown to users. Navigating through the intricacies of EBS becomes paramount, considering its pivotal role in building file systems for EC2 instances. This article delves into the best practices for cost optimization, shedding light on how to leverage EBS volumes and snapshots efficiently. Whether you are grappling with different volume types, seeking to minimize costs without compromising performance, or ensuring the appropriate use of EBS snapshots, this guide will help you navigate the complexities and provide actionable insights for prudent cost management.
Amazon EBS (Elastic Block Storage) is one of the main services we use when working with cloud infrastructure and virtual machines. This service has several components that may incur hidden costs you might not be aware of that can put a dent in your monthly cloud bill.

How to Choose the Best Volume Type

Depending on your needs, you may choose from different kinds of EBS volumes offered by Amazon Web Services (AWS).

Let’s dive into the different volume types:

  • Standard Multi-Use (SSD): The most common type, which is well-suited for many kinds of workloads, including development/test environments and small to medium-sized databases. The SSD disks can be utilized with General Purpose, gp2 or gp3, or io1 and io2, for database applications that are I/O heavy and need constant, low-latency performance.
  • High-Density Disk (HDD): Ideal for data warehousing and log processing, two applications with huge datasets requiring frequent access.
  • Cold HDD: Developed for workloads that aren’t accessed often, emphasizing cost-effective storage.

When to use each volume type

Several kinds of storage options are available in EBS, each with its own price point and degree of performance. You may choose the one that’s most suited for your workload.
Unless application performance demands differ, utilize General Purpose for SSD volumes (gp2, gp3) instead of volumes with Provisioned IOPS, like io1 and io2.

The io1 and io2 volume types are worth considering for latency-sensitive applications or workloads that are I/O heavy. Database operations and other workloads with high I/O operation sensitivity to storage consistency and performance may be able to use the provided IOPS SSD (io1 and io2) volumes.

You have the option of Provisioning I/O Per Second (PIOPS) for all volume types, but the range of PIOPS differs between each type.

Best Practices for Cost Savings with EBS Volumes

  1. Volume Upgrade: Upgrading to a volume of a newer generation type within the same EBS category. While gp2 volumes are still in production and are the default option when launching an EC2 Instance, gp3 volumes are the newest additions to the family of general-purpose volumes and guarantee higher performances. Upgrading from gp2 to gp3 will save you 20% of your costs.
    Regarding the io family, while you may still have the older io1 volume type provisioned, with the newer io2 and io2 Block Express, you will achieve better IOPS performance.
  2. Define the desired IOPS: For gp3 volumes, there are 3,000 IOPS and 125 MB/s throughput, which are included in the volumes’ performance baseline with no additional costs. With gp2 volumes, you’ll need 1,000 GB of storage to get 3,000 baseline IOPS. You may achieve your 3,000 IOPS performance target with as low as 1 GB of storage when using gp3 volumes. Io1 and io2 volumes also offer PIOPS of up to 64,000 IOPS per volume. However, in this case, the charges will be from the first I/O. It’s also important to choose the correct volume based on the desired number of IOPS (since gp3 is cheaper than io2, and you will get the first 3,000 IOPS for free). See below a pricing comparison of the different volume types-
  3. Unattached EBS Volumes: When deleting an EC2 instance, the disks that are attached to it by default will keep on running. Therefore, monitoring your volumes and deleting the unattached ones is imperative. Another preventive measure can be that when launching a new EC2 instance, you can choose the “Delete on Termination” option during the instance configuration.
  4. Stopped Instances: There will be scenarios where we’ll stop our EC2 instances for a while but won’t terminate them. Even when the instances are stopped, the EBS Volumes will continue to generate charges. In this case, it’s important to monitor these volumes and even modify them to Snapshots, which cost 50% of the EBS cost. Once the instances are back to running status, you can change the Snapshot to a new EBS Volume and attach it to the EC2 Instance.

EBS Snapshots

EBS Snapshots allows you to backup your data on EBS volumes to an Amazon S3 bucket using point-in-time snapshots. Since Snapshots are incremental, they only save the device blocks that have changed since the previous backup. Because each snapshot has all the essential information, you may use them to restore your data (from the snapshot date) to a new EBS volume. When you build an EBS volume from a snapshot, the latest volume will be an exact replica of the old one. The data is loaded in the background with the mirrored volume, so you can start using it immediately. The price of your snapshots is based on the size of your EBS Volume. Because snapshots are incremental, deleting them will not result in storage cost savings. A deleted snapshot will delete any data it referenced, but snapshots that refer to other snapshots will not.

Best Practices for Cost Savings with EBS Snapshots

1. Lifecycle Policies: Define organizational policies for your snapshots lifecycle (for example, delete snapshots older than 6 months), and later create DLM policies in a way that saves only the necessary snapshots.

2. Snapshots Archive: Snapshots could be preserved as archival data. If you need to keep point-in-time copies for archiving purposes, you may utilize EBS Snapshots’ archive settings or AWS Backup. You will immediately optimize your costs with these lower price categories, which provide reduced cost per GB pricing (75% discount compared to Standard Snapshots). You may manage your backups according to your archive or compliance needs by creating and maintaining archive rules using AWS Backup.
See below a comparison between Standard Snapshots and Archival Snapshots

In AWS Console

How to find on AWS Cost Explorer Console

  1. “Filter by Service → EC2-Other”
  2. “Filter by Usage Type Group → Select like EC2: EBS entries from drop-down”
  3. “Group by → Usage Type”

AWS Trusted Advisor

AWS Trusted Advisor is a free-of-charge cost optimization tool. It can provide you with extra recommendations on your EBS usage.

How to find on AWS Console

  1. Search for Trusted Advisor.
  2. Recommendations -> Cost Optimization.
  3. Search by keyword → EBS

In summary

This article provides essential guidance for optimizing Amazon EBS (Elastic Block Storage), emphasizing the importance of choosing the most suited volume types based on specific workload requirements, whether SSD or HDD. Key recommendations include upgrading to more cost-efficient volume types like gp3 for potential savings of up to 20%, strategically managing IOPS requirements, and effectively handling idle volumes.

The article also underscores the significance of EBS snapshots for data backup, advocating for adopting lifecycle policies and archival methods to minimize costs. Utilizing AWS Trusted Advisor for regular assessments can further enhance cost-effectiveness and performance. These final recommendations aim to assist users in achieving a balanced approach to high performance and cost efficiency in their Amazon EBS usage.

Stay tuned for Part 2!

Authors

  • Rotem Levi, Cloud Security Architect, CloudZone
  • Vera Barzman, FinOps Analyst, CloudZone