How do we cut down our client’s hosting cost for one app from $100/month to $10/month?
They host a number of mobile applications which have a typical 3-tier architecture: a front-facing mobile, an API application, and a database. Previously this monthly AWS bill came to just over $100/month:
Here is a list of simple tricks you can try for your web application to cut down hosting costs:
- Choosing a better EC2 instance. If you use EC2 instances, you can upgrade to higher generation tiers (the latest is the t3 tier). We upgraded the “t1” tier to “t3” and moved from the “medium” type to “nano”. The performance improvement from t1 and t3 is so significant that t1.medium is faster than t3.nano. But, the cost goes down from $36/month to $3/month.
- Not using RDS instances. If you don’t have a high load application but rather have 200-300 users daily, you can get rid of your RDS instance. This will immediately save you $19.80/month. Of course, don’t delete the database entirely since your application relies on it. Instead, move it under… yes, same EC2 t3.nano instance. To do that, you have to install the database server right on the instance itself. Although the instance only has 500Mb of RAM, you can create a swap file 3-4Gb in size which would be sufficient to have the webservers and database on the same instance for low load applications.
- Reducing snapshot storage size. HDD, or snapshot volumes, also costs some cash. In our case, we had 124Gb total capacity but were barely using 20%. We decreased the capacity down to 25Gb which dropped the price from $13.52/month to just $3.49/month.
- Cleaning up other unused instances. It is a great idea to review your resources monthly and decide which can be deprecated (such as storage, snapshots, or services). Very few of these come free with AWS.
After all these steps, we measured the performance of our servers and it had noosted. Costs saved, performance increased! Woohoo!
You can get yearly savings plan to drive down the cost of the EC2 instance even further (to somewhere around $2/month).
Keep in mind that all these optimizations work for low to medium-load applications. You should also have a plan in case the load increases significantly once the app/website grows:
- Create a Load Balancer (appx $14/month) and create multiple instances behind it using the same t3.nano instances at $3/month each. We might want to create 2-3 (or more) depending on the application load. Even if we create 5, this will only drive the cost up by $14+(3*5) = $29/month. Not a big deal.
- We might want to move the database base to RDS. This will raise the cost by $19.80/month or more depending on how powerful the RDS instance needs to be.
AWS has great flexibility and provides a lot of benefits for companies but without proper resource management, it’s easy to go over budget. This is especially true when you have an enterprise-grade architecture with hundreds of instances, components, and services. It is always best to trust a team that can help transparently optimize your resources and save up to 90% on your cloud services.