How to optimize your AWS costs? 10 ways to reduce your AWS bill
Back4App is a heavy Amazon Web Services user and we run most of our infrastructure on this cloud provider. We will show you how we delivered $500,000 in yearly Amazon Web Services savings. Software development companies, startups, and enterprises can benefit from this article because:
- It provides effective and proved ways to reduce AWS spending;
- We show how to have short-term and low hanging fruit gains;
- Most of the procedures are simple and demand only planning and hard work.
The actions described in this article are based on our own experience managing cloud infrastructure and translated in successful cost reductions. Here is a brief checklist of what you will find reading this report.
- EC2 – Reduce instance sizes
- EC2 – Optimize idle resources with auto-scaling
- EC2 – Reserve instances on the Marketplace
- EC2 – Standard instances are cheaper than Convertible instances
- EC2 – Try Spot Instances
- EC2 – Upgrade to new generation instances
- EC2 – Enable enhanced network for maximum performance
- EC2 – Cost varies by region. North Virginia is the cheapest option
- EBS – Terminate Instances instead of stopping it
- EBS – Prefer Magnetic storage over SSD
- S3 – Choose your S3 storage class
- S3 – Place an endpoint in your VPC
- S3 – Monitor your S3 requests very closely
- S3 – Backup your data here. Avoid EBS for this purpose
- Data Transfer – Make sure you are connected to a CDN service
- Data Transfer – Moving to CloudFront may save you a lot of money
- Data Transfer – Single availability zone will reduce inter-AZ costs
- CloudFront – Evaluate a long term Private Contract
- Global – Get volume discounts bundling all your accounts
- Global – Request credits every time there is an AWS related downtime
- Credits – Look for AWS credits every time as you can
- Monitoring & Reporting – Have clear cost reduction goals
- Monitoring & Reporting – Establish a regular cost-saving routine
- Monitoring & Reporting – Tag everything
Our cost reduction actions were monitored using a simple but very effective spreadsheet. You can download it using with the link below:
1. EC2 – Elastic Compute Cloud
The most straightforward savings are obtained optimizing EC2 – Elastic Cloud instances. Usually, it’s not so hard to have easy and fast gains simply reevaluating instances sizes and shutting down unused ones. Please make you use last generation instance types. They are cheaper and have more processing power.
Please download the spreadsheet that will support you in this process.
The next cost-saving step is to have long-term (12 or 36 months) reservations for the instances you run 24/7. You can reserve the instances directly from AWS or purchase them on AWS Marketplace. If you use Elastic Cache (Redis), you can also reserve nodes.
A more sophisticated action is to implement autoscaling to optimize idle resource utilization. Pay only when you actually use the instances. To reduce costs even further, use Spot Instances to scale-up your resources.
2. EBS – Elastic Block Store
Generally speaking, please make sure you don’t backup data here. Use S3 for it.
Understand if you have the right EBS volume attached to each instance. Each volume must have an accurate size and the correct type. SSD volumes are twice as expensive as Magnetic volumes.
3. S3 – Simple Storage Service
Choose the correct storage class for each type of data. For example, S3 Glacier is 5x cheaper than S3 standard and should be used for data archiving.
Monitor and understand your S3 requests. Bear in mind every time you move data from one storage class to another, you will incur in S3 API request costs.
Here a very useful tip for high volume accounts. Installing an S3 endpoint in your VPC provides any traffic to S3 its internal road, and AWS won’t charge you like public transfer.
4. Data Transfer (ELB & S3)
Please make sure your endpoints are connected to a CND service. This will save you data transfer related to the data that could be cached.
AWS has three major data transfer costs that are Transfer Out, Inter-Regions and Inter AZ. Some ideas below to reduce costs:
- Transfer-Out: Move to CloudFront
- Inter AZ: Centralize noncritical applications under a single AZ
- Inter-Region: Centralize noncritical applications under a single Region
Generally speaking, for the same levels of usage, CloudFront is cheaper than ELB data transfer. AWS is much more flexible in providing volume discounts and signing long-term contracts. Depending on your negotiation and volume, CloudFront transfer costs may be reduced to $0.02/GB.
If you run several AWS accounts, please make sure you link all of them to a root account. This simple action will give you volume discounts, and the charged will be based on the total usage of all accounts.
Let’s consider you have 10 AWS accounts and each account stores 50TB.
If the accounts are not linked, you will be charged as follows:
- 50TB x $0.023 x 10 = 50 x 1024 GB x $0.023 x 10 = $11,776/month
If you bundle the accounts, you will be charged as follows
- Total Storage: 500TB
- 50TB x $0.023 = 50 x 1024 GB x $0.023 = $1,177.60/month
- 450 x $0.022 = 450 x 1024 GB x 0.022 = $10,137.60/month
- Total Cost = $11,315.60
So, in the hypothetical scenario, you would save $460.80/mo or $5,529.60/year linking all your AWS account.
This same logic can be applied to data transfer, CloudFront, etc.
Most of the gains here are related to Startup credits! AWS has several startup perks, and the amount of credits can go up to $100,000. Enterprises or software development companies can always ask for credits to test AWS services, but the amount you will receive will be much smaller in comparison to the number of credits delivered to Startups.
8. Monitoring & Reporting
You can monitor AWS spending using its own internal tools like Cost Explorer or Cloud Watch. You can also integrate to external services like Sumo Logic or Dynatrace.
Do you need more detailed information on how to implement AWS savings? If that is the case, please read the detailed version accessing here.
So, do you like the results we produced? Has it benefited you to optimize AWS costs?
Should you would like to add to this article, email me at [email protected], and I will be happy to incorporate your contribution.
Your comments are also welcome!