In this article, we discuss on an overall thought process that can help you start with your cost optimisation journey. This is a generic framework and you will have to tweak to fit it to your needs.

🌿 Step ♾️ : Organic cost optimisation

Organic cost optimisation implies methods like right-sizing your instances, improving application performance, rearchitecting your applications and so on. These usually take a lot of engineering time and are not always quickly possible. In our experience, one should start with inorganic measures and make a long term plan for organic measures. Organic measures are however most impactful and must be a part of every team’s roadmap.

🥷 Step 1: Terminate unused resources

Unused elastic IP addresses, disks, old snapshots, stopped instances, testing instances that someone forgot to terminate.

Unused elastic IP addresses cost you money. I have seen accounts spending over $500 a month in just unused elastic IPs. Similarly, there are often times when a dev requests an instance for running an experiment for a week and no one remembers to terminate instances. It is pretty normal to have unused resources make up 10%-15% of your AWS bills.

❄️ Step 2: Spot Instances

They are the cheapest (upto 90% discount from on-demand pricing), most flexible but slightly inconvenient way to optimise your AWS bills. There is no commitment required, but AWS can reclaim your instances when EC2 (on-demand) requires it. AWS provides a two-minute notification before reclaiming the spot instance allowing graceful shutdown of workloads. If your applications are stateless and fault tolerant, you can leverage this and run your workloads extremely cheap. These are however not good for databases, caches etc as they are inherently stateful.

💸 Step 3: Select cheapest instances

C series instances are cheaper than M series instances, which in turn are cheaper than R series instances. There are versions of these three with an extra d for added disk. They are more expensive than equivalent instances of their corresponding base families (c6gd.large is expensive than c6g.large). Graviton instances are cheaper than AMD which in turn are cheaper than the Intel ones. Similarly, there are hundreds of types of instances and you need to select the instance family that can run your workload with minimal cost.

🤑 Step 4: Buy some compute savings plan

Start with a very small commitment for compute savings plan and buy it. It can be as low as 5% of your monthly spend. Go through our Savings Plan - Overview guide to learn more about it.

💰💰💰Step 5: EC2 instance savings plan

Once you have identified the workload which can be run on spot instances, you can focus on rest of your instances for optimisation. Try to bring uniformity to instance family among your EC2 instances (see: Standardising Instance Families to Reduce Costs). Once this is done, you can start buying EC2 instance savings plan for the estimated spend.

🔄 Step 6: Repeat constantly

Cloud costs pile up slowly over a period of time. You must keep auditing your bills and optimise constantly.

Next to Read

Savings Plan - Overview