October 16, 2017

5 Cost Saving Strategies When Using AWS

Amazon Web Services, or AWS, offers reliable and scalable cloud computing services. More and more companies are realizing the benefits and are migrating their resources to AWS. AWS provides an extensive list of services, and each service comes with a pricing matrix. This blog post contains some of the general considerations on reducing AWS cost, with a focus on some of the popular AWS services.

It’s hard to overstate how much of a cost impact optimizing your AWS instance can have. For one client, 3Pillar was able to recommend and make changes that led to a reduction in monthly spend from $200,000 to $50,000.

EC2 Pricing

Besides dedicated hosts, there are three ways to pay for Elastic Computing Cloud (EC2) instances: On-Demand, Reserved Instances, and Spot Instances. On-Demand instances are the most expensive.

After experimenting to arrive at desirable EC2 instances, it is a good idea to purchase reserved instances for a one or three-year period, which can save about 30% to 50% of the cost. The Relational Database Service (RDS) also offers reserved instances. In the case of DynamoDB, if the read/write capacity is predictable, one can purchase reserved capacity as well.

Spot EC2 instances offer a steep discount when compared to On-Demand prices. That said, it is important to identify proper use cases of spot instances because they are subject to termination due to price fluctuation. For example, a (time-insensitive) batch processing application can use a fleet of spot instances, and an Elastic MapReduce (EMR) cluster can employ spot instances (together with On-Demand instances) as the task nodes. AWS also offers spot instances of predefined duration. These spot instances protect from termination due to spot price fluctuation for up to 6 hours.

EC2 (and RDS) instances are chargeable by instance per hour. You should stop (or terminate) the instances that are not in use. For instances that are only required to be up during a certain time window, it is a good idea to apply automation.

Storage Optimization

AWS offers various storage options – Elastic File System (EFS), Elastic Block Store (EBS), Simple Storage Service (S3), and Glacier. It is important to understand their capabilities and the proper use cases. The pricing of these storage options is wildly different, with EFS being the most expensive and Glacier the cheapest. It is possible to use a combination of all these storage options to offer the best of performance, cost-saving, and data durability.

S3 deserves particular attention here. Not only is it highly durable, scalable and much cheaper than EFS and EBS, but it also integrates with Elastic MapReduce (EMR), Athena, Kinesis, and many other services to do data processing, analysis, and queries. Also, it is good practice to set up lifecycle management on S3 objects to further lower costs.

Data Transfer Cost

For data-intensive applications, particular attention to data movement among different components is well-deserved because AWS charges a data transfer fee in some scenarios and not in others. The overall system architecture in AWS is the key. Architect the systems so that there is minimal data transfer across AWS regions or availability zones. Another good practice is to set up Virtual Private Cloud (VPC) endpoints to create a private connection between the VPC and other AWS services without requiring access to the internet, through a NAT device, a VPC connection, or AWS Direct Connect.

License Fee

Generally speaking, there are two kinds of licensing models when it comes to using licensed software (by using AMIs in AWS Marketplace): one is the Bring-Your-Own-License model, the other is the license-included (with the instance) model. You should evaluate both options depending on the use case and choose the license mode accordingly. It makes sense to choose the license-included mode during the experimenting/testing staging, and evaluate the Bring-Your-Own-License mode later.

AWS Trusted Advisor and Billing Statement

AWS offers Trusted Advisor for free. It is an online resource to help you reduce cost, increase performance, and improve security. Visit Trusted Advisor from time to time and consider implementing the recommendations it provides.

Also, it is a good practice to monitor and understand your AWS bill each month to see if there are measures to take to reduce the cost, paying particular attention to cost spikes by comparing them with previous bills.