Software Consulting, Startups, Design & Development | Adhish Technologies Pvt Limited

How to reduce costs in AWS services

We (Adhish Tech) pretty much use almost all the popular services in AWS including Redshift, Aurora, Firehose, EBS etc. AWS Cloud services save you a lot of money compared to dedicated instances and it allows you to scale up and down based on the predicted traffic.

There is a popular misconception that cloud services pretty much take care of themselves and you don’t have to worry about the costs. But that is wrong, if you aren’t really careful with the number of instances you spin up or the services you use, then the cost will add up pretty quick and it can get really expensive. In the end, you will be surprised with the bill which can be multiple times more expensive than your previous hosts.

It’s always advisable to keep an eye on the Billing Dashboard and check the costs associated with each service regularly.

Steps to reduce costs

There is a ton of help on the web to reduce the costs and a few good ones are listed below.

If you are like us who use a lot of Elastic Bean Stalk instances and Aurora databases, then you will need to go through these important cost optimizations.

Optimizing Aurora I/O Requests

AWS Aurora is a relational database management service which hosts MySql and Postgres database instances in the cloud.  For more information on AWS Aurora https://aws.amazon.com/rds/aurora/.
 

With respect to Aurora Costs, there will be three different components

1. Costs associated with the Aurora service. This is pretty consistent and it depends on the size of the database instance you choose. It doesn’t change unless you upgrade or downgrade the instances.

2. Storage. This varies and depends on the size of the database. If your database grows gradually then you will see a steady increase in the costs.

3. I/O. This is the money pit. Basically I/O refers how many I/O requests made by the queries against the data. 

If you aren’t careful with the I/O requests, then the costs can spike at a rate which can be multiple times of the service itself. You need to get inside the database of the application and start optimizing the database sql queries. Some of the suggestions including
1. Review the sql queries with the execution plan. Make sure the Queries utilizes the indexes properly. Eliminate unnecessary joins. Clean up the SQL as well.
2. Review & Optimize Indexes. Add new indexes on tables if required and remove unused indexes as well.
3. Implement caching on the services side. So you can eliminate the number of SQL’s hit against the DB.
4. Archive old data from Database. As this will greatly improve the health of the tables and speed up the Indexes and Queries.

In one instance, we were able to bring the cost of Aurora service by almost 1/4 by optimizing the SQL queries. Optimizing SQL queries will greatly improve the health of the application as well.

Utilizing shared Load Balancers in Elastic Bean Stalk

AWS Elastic Bean Stalk or EBS is an easy to use service to host Docker, NodeJs, .Net etc applications. For more information on EBS https://aws.amazon.com/elasticbeanstalk/

If you have configured EBS with high capability, then you have to choose a load balancer. The default configuration will be Application Load Balancer and it will be great to handle and scale traffic based on the application needs.

If you have mutiple EBS instances, then you will end up with one loadbalancer per instance and it will get really expensive over a period of time.

Fortunately, AWS provides an option to share load balancer across different EBS instances. With shared load balancer, you will be able to fully utilize the load balancer and at the same time you will be able to reduce the costs. 


Thank you for reading !!!!. 

Leave a Comment

Your email address will not be published.