<img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=2877026&amp;fmt=gif">

Common AWS Cost-Saving Measures

By Robert Sanders - August 27, 2021

A few steps that you can take to reduce the Cost of Operating on Amazon Web Services

Amazon Web Services (AWS) provides a variety of valuable services that many organizations can utilize to run their workloads. From Elastic Beanstalk (to run scalable Web Applications) to Elastic MapReduce (to run scalable Big Data workloads) to spinning up simple Virtual Machines, there are a host of benefits to being in the Cloud. It's to the point where you don’t have to worry about having your own Data Center anymore. Not to mention that spinning up instances is as easy as a few clicks. What would have taken a month of ordering, placing in your data center, spinning up and patching, can now be done in less than 10 minutes.

But, its ease of use can also be its downfall for many organizations. Along with making it so easy for people to quickly spin up instances and use services, it also makes it easy for organizations to rack up a huge bill. In this blog, I will detail a few steps that you can implement to reduce the overall cost of operating in AWS.

Use and Regularly Review Billing Center

To see a breakdown of your bill, go to the ‘Billing Center’ in the AWS Console. It is through here that you can also setup Billing Alerts that warn you in case your bill crosses the desired amount.

Note: Your user will need to be an admin or possess the BillingAccess IAM role

Billing Center Sample
Billing Center Sample — source
Month Breakdown Sample
Billing Center — Month Breakdown Sample-source

Get Suggestions from Trusted Advisor

Amazon provides a service called Trusted Advisor that can be accessed from the AWS Web Console. Within, there is a ‘Cost Optimization’ section which provides recommendations like the ones I'm going to be mentioning below based on your personal AWS environment. This is a great way to get an idea of what you could reduce or modify based on your own usage.

Cost Optimization Tab Sample
Trusted Advisor — Cost Optimization Tab Sample — source

Tag ALL your Instances

When creating instances, you can add Key-Value pairs to the instances to be viewed from the Web Console.

AWS Tagging Screen
AWS Tagging Screen

While this doesn’t directly work to help you save money on your monthly bill, this can, however, provide details on what these instances are used for. In an organization where you might have anywhere from dozens to hundreds of people using AWS to build instances, it can be very difficult to identify the purpose of a machine by its name alone. Having a policy in place to have owners Tag their instances with information like who is the owner and what project it’s associated with, can really help you identify if a machine is still really needed.

Note: This will really help with the subsequent steps

Delete Unused EC2/RDS Instances

This is a bit obvious but is at least worth pointing out. If you’re not using an instance anymore, whether it be an EC2 or an RDS instance, it would be a good idea to terminate it. Even an EC2 instance from the free tier might still be costing you money if you mounted an EBS (Elastic Block Storage) disk to it.

Purchase Reserved Instances

Most people purchase On-Demand instances when spinning up new EC2 instances. This means they will bill you for how much ever time the instance runs. In many cases though, we’ve found clients to never need or want to stop these instances and intend on having the machine running for years.

A perfect example that most organizations might experience would be hosting their corporate websites in the cloud on an EC2 instance. They will probably never bring down the instance except for the occasional patching.

In this case and many other examples like it, it makes more sense to purchase Reserved Instances from AWS. In exchange for paying all or a portion of the costs of the machine upfront, you can get some substantial savings over the long run.

To give you some idea on the savings potential:

Spot Instance of a t3.2xlarge per year (us-east2) = $243.61

1 year upfront Reserved Instances t3.2xlarge (us-east2 )= $100.00

Purchase Spot Instances

If you have a need for infrastructure, i.e on a more ad-hoc/on-demand basis, AWS also offers Spot Instances. These instances are spare EC2 instances that AWS has lying around which boasts savings up to 90% of On-Demand pricing.

Reduce EC2/RDS Instance Sizes

Sometimes when you build an instance in AWS, you might have an idea on the load of the instance and the required number of resources. But then that guess turns out to be wrong and you actually need much less. In those instances, it makes sense to reduce the overall size of the instance.

A good way to determine this is to identify if the CPU Utilization and Memory Usage on the machine is consistently very low.

To give you some idea on the savings potential:

t3.2xlarge (us-east2 ) = $243.61

t3.xlarge (us-east2 ) = $121.81

Reduce the size of EBS Volumes

Similarly, sometimes when you build an instance, you think you might need a lot more Disk Space then you have actually utilized. Or perhaps you may have needed a large volume only during the step-up process and may not need as much once the application or workload starts running smoothly. In such instances, it makes sense to reduce the size of the attached EBS volume.

To give you some idea on the savings potential:

1 TB of Storage = $97.00

500 GB of Storage = $47.00

Delete Unused EBS Volumes

When you opt to terminate an EC2 instance that has EBS volume(s) attached to it, sometimes whoever does the termination might miss checking the box that deletes the attached EBS volume(s). Doing this often can result in dozens of EBS volumes sitting there without an owner. These instances will also continue to cost you money, even if they aren’t attached to instances.

Migrate data from S3 to Glacier

S3 storage is a great service to use to have a central storage system for those looking to take advantage of Redshift, EMR and more services. But there is a cheaper option similar to S3, called Glacier. It is intended for “cold storage” or for those records that needn’t be accessed very often. If you find that you have data sets that you won't need to access, perhaps application logs from several years ago, then you can save some money by setting up a job to periodically migrate data from S3 to Glacier.

To give you some idea on the savings potential:

1 TB of data in S3 (us-east-2)= $23.44

1 TB of data in Glacier = $4.10

Purge from S3

Similarly, in the event that you know that you will never use a particular file or set of files, it makes sense to delete them rather than to have them sit around and eat up money.

Delete unallocated Elastic IPs

Elastic IPs, if you’re not familiar, are a way of ensuring that an EC2 instance will always have the same IP address even after a restart. Elastic IPs are actually totally free if they’re being used by an instance. But Amazon will charge you $0.01/hr for each Elastic IP that is not used.

So if you have 1 Elastic IP that isn’t used throughout an entire year, you’ll be charged: $87.60

Author
Robert Sanders

Director of Big Data and Cloud Engineering for Clairvoyant LLC | Marathon Runner | Triathlete | Endurance Athlete

Tags: Cloud Cloud Services Cloud Computing System Administration AWS Data Operations