{{announcement.body}}
{{announcement.title}}

How We Reduced AWS Bill from $2,000 to $200

DZone 's Guide to

How We Reduced AWS Bill from $2,000 to $200

The journey of writing GreenBot (AWS cost analysis tool) OUTREACH ALM

· Cloud Zone ·
Free Resource

Background

A while back I worked on one Batch processing application we'll call Project X.

The way Project X used to work is that whenever the user schedules a new job, EC2 Spot (t2.2xlarge) would be requested and that EC2 Spot will process that particular job. Once a job is finished that Spot instance would terminate itself.

Our AWS cost for Project X quickly rose from a few hundred to $2,000 as more and more users started using it; thus we needed to find a way to reduce it.

Journey to Reduce AWS Cost

To be honest, reducing the AWS bill is an easy task given you have good monitoring and understanding of AWS resources.

1. Instance Types

I was showing AWS console to one of my friends (who is good with AWS), and the first thing he asked is, "Why are you still using t2 instances?" 

Turns out a newer generation of t3a instance are 20-30% cheaper t2 instances and offer the same performance.

So just by changing the EC2 launch template, we saved 20% in costs!

2. Instance Utilization

Project X had a t2.2xlarge (8 vCPU and 32 GB RAM) machine configured for each job but when we started to dig into CPU utilization of job machines we noticed that more than 90% of jobs are very lightweight and can be run on t2.small which is 16 times smaller than t2.2xlarge

The reason it was never caught is due to too little monitoring.

After these two basic changes, we were able to get the AWS bill to around $200.

3. Tools to Tackle the Cost

Turns out there are not many tools which can give you tips on how to reduce cost (at least I could not find it)

AWS has a few tools like AWS trusted advisor which I felt fall short of many aspects and it has its own cost associated with it.

4. Conclusion

This led me to write GreenBot.

GreenBot is a rule-based system that tries to find ways you can reduce AWS cost.

I was able to cover a few common cases like:

  1. Checking if the older generation of EC2 is being used
  2. Locating underutilized EC2
  3. RDS optimizations
  4. Checking for orphan EBS Drives
  5. and kit 
Topics:
aws ,aws costs ,aws instances ,cloud and devops ,cost reduction ,t3a instance

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}