How to reduce the cost of hosting applications on AWS by 10x?

Andrey A.
Andrey A.
July 8, 2022 •3 min read

It is no secret that many companies overpay for AWS services. The bigger the company, the higher the overhead. Hosting alone can cost $1,000-$5,000 per year for a single application or company website. Multiply this by the number of development environments and other apps, and the cost can be anywhere from $100,000/year to $3M/year (we have seen such cases, too). There are a few simple steps you can take to reduce the bill significantly. Let's consider a few tricks.

Main banner

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 per month:

BEFORE

not optimized hosting costs

Here is a list of simple tricks you can try for your web application to cut down on hosting costs:

  1. Choosing a better EC2 instance. If you use an EC2 instance, 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. However, the monthly cost is reduced from $36 to $3.
  2. 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 per 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 that is 3-4 GB in size. It would be sufficient to have the web servers and databases on the same instance for low-load applications.
  3. Reducing the snapshot storage size. HDD, or snapshot volumes, also costs some cash. In our case, we had 124GB of total capacity but were barely using 20% of it. We decreased the capacity to 25GB, which dropped the price from $13.52/month to just $3.49/month.
  4. 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.

We measured the performance of our servers after completing all of these steps, and it had improved. Reduced costs, improved performance! Woohoo!

AFTER

hosting costs after optimization

Additional steps. 

You can get a 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 or website grows:

  1. Create a load balancer (approximately $14/month) and create multiple instances behind it using the same t3.nano instances at $3/month each. Depending on the application load, we may want to create 2–3 (or more). Even if we create 5, this will only drive the cost up by $14 + ($3 x 5) = $29 per month. It’s not a big deal.
  2. We might want to move the database 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 you up to 90% on your cloud services.

Ready to launch your project?

Once we know more about your goals and timeline, we'll start assembling your custom team