Keeping Your AWS Cloud Costs Low
Pay-as-you-go pricing models are great for a variety of reasons, but often, they fail when organizations are unable to manage them. And that’s a growing problem as more companies adopt the cloud.
The cloud is an excellent choice for rapid provisioning and unprecedented elasticity requirements. The problem is that it’s almost too easy to spin up services. With this in mind, even with a PAYG model, costs add up over time.
We’re going to explore methods that you can use to keep your AWS costs under control — with minimal operational overhead.
Reserve EC2 Instances: It’s Cheaper
When you spin up an EC2 instance, the default option is to run them on demand. This means that you are charged for every second an instance is runs. This billing model is great in cases where you only intend to run the instance for a short period of time. What you need to keep in mind, though, is that this is also the most expensive way to pay for an EC2 instance.
One quick way to reduce EC2 costs is to switch to reserved instance billing. Using this model, you choose a time period and commit to paying for that EC2 instance upfront. To show how much you can save, here is an example using a t2.medium instance running Linux on a 3-year upfront, reserved bill:
- On-demand (3 years) = $1222.92
- All upfront and reserved (3 years) = $458.00
That’s over 60% in savings for one instance.
AWS is incredibly flexible with its pricing. They also offer 1-year reserved instances, which won’t save you as much, but they are great for when you don’t want to commit too far in advance. You can also partially pay upfront for AWS reserved instances. With this billing model, you pay a small upfront fee, and then the rest is paid monthly, the savings under this model are quite good too.
Use Newer AMD Instances: They’re 10% Less Expensive
Toward the end of 2018, AWS introduced EC2 instances using AMD EPYC processors. Using AWS over the traditional Intel EC2 instances can save you up to 10% on your compute costs. Taking a look at the t3.nano Linux instance and comparing it to the t3a.linux instance, the savings are obvious.
- t3.nano on-demand = $3.81 per month
- t3a.nano on-demand = $3.45 per month
This is a 9.4% saving just on the on-demand price. If your organization is using hundreds of these or other instance types, then it can be extremely cost effective to migrate your workloads to AMD-based instances.
Intelligent Tiering for S3
Also in 2018, AWS announced S3 Intelligent Tiering. This service automatically cost-optimizes S3 storage based on data access patterns. This has no performance impact or operational overhead at all because AWS fully automates it for you.
The way this works is by moving S3 data between Frequently Accessed and Infrequently Accessed storage tiers. Data is transferred only when access patterns suit the storage tier type.
The service isn’t 100% free. There is a small fee for the monitoring and movement of the data but if you have data that changes between frequently accessed and infrequently, this could be a significant cost saver.
You should also consider the operational costs of identifying and manually changing storage tiers for your application into your decision.
Understand Your Largest Costs
A little known service provided by AWS is Cost Explorer. AWS Cost Explorer is a free tool to deep dive into your consumption. Unfortunately, AWS bills are not detailed enough to give you any meaningful information on how much you are spending on a per-project basis. The good news is that Cost Explorer is rather good at breaking down consumption at the granular level.
Cost Explorer includes valuable filters to better understand your usage. The filters are useful because they can be used to double check expenditure by region, tags and charge type. If a charge based on these filters is not what you were expecting, then you can quickly locate the resources that generated that cost.
Region Selection is Key
Your AWS services are typically hosted in a region closest to your end users. While sometimes policy and regulation impact the decision process, there are usually a few different regions that you can choose from.
Some regions are cheaper than others. For example a t3.2xlarge EC2 instance in EU-London would set you back $276.41. However, in U.S. East – N. Virginia, it’s $243.61 per month. With more than a 10% savings available for proper service placement, be sure to analyze where your services are located and adjust accordingly.
It’s not just EC2 services that you can use this region trick for. Almost every AWS service is region bound, so ensure you look at every service which you utilise for best cost efficiency.
Powered-Off EC2 Instances Cost You Nothing
If you have development or other non-production systems, consider turning them off when not in use. The advantage of EC2 is that you only pay for the compute services when they are turned on. EBS volumes will still incur a fee, but you can save a significant amount of your budgets by just turning off unused instances.
You could quite easily implement power-down scripts for test machines to automatically power down at a certain time every day. If you also consider that an 8-hour working day is only 1/3 of 24 hours, you could potentially save 2/3 of your test & development EC2 costs.
Do You Really Need an External Database?
Large applications will typically require an external database, and this is a generally accepted best practice. However, if you are running a small, infrequently accessed web server with a database backend, you might not need it to be external.
Take small hobbyist sites or internal wikis as an example. Nothing is preventing you from installing the Database within your EC2 instance. This does come with operational overhead because you need to maintain it yourself. But you might be able to justify it if you are looking to cut down some of your costs.
Remember: AWS has a Free Tier
Should you be looking to implement a new service, be sure to check out the always free tier. There are many services that AWS offers for free (some with and without limits). You might find that you can switch from using one AWS service to something from the free-tier options to save a little extra from your budget.
A prime example of this would be if you were looking to use an external email service for mail delivery. With the AWS always free tier you get 62,000 outbound messages per month at no cost.
Another case for this would be to consider a No-SQL database for your service. Considering that you get 25GB of DynamoDB for free every month, there are savings here too.
The Bottom Line
While the AWS pay-as-you-go model offers a lot of flexibility for organizations, it’s important not to let costs become unmanageable. With a few adjustments here and there, you can ensure that your AWS usage doesn’t hurt the bottom line. We hope these ideas and tips can help you not only control costs, but get the most out of your investment in the AWS cloud.