DEV Community

Cover image for How to save 70% of AWS Compute Costs for non production workloads?
3

How to save 70% of AWS Compute Costs for non production workloads?

Welcome to fellow AWS Cloud aspirants for a basic AWS Cost optimization post with brief points & an architecture diagram for the same. 

Intention is to highlight scope & potential of applying cost optimization in non production workloads as well. This example, is considering a web application tier in Public Subnet, business logic tier & RDS backed database in individual private subnets

Image description

Above is a basic representation of a simple web application with business & database tier implementation. Below is the order to save costs

  1. Resources EC2, RDS should be created with Key,Value tags for this design to work. To enforce this, the user or source which creates these resources should be attached with IAM policy aws:RequestTag condition(s)
  2. Assume that these resources are now created with resource tag(Key:Value)
  3. Create a Amazon Event bridge rule with cron scheduler time defined as according to your nature of business purpose
  4. Prepare a python boto or any other script to start & stop these instances & RDS instances according to cron scheduler and key value tags defined with the respective resources
  5. Watch the cost being saved from the moment this setup is up & running

While the steps & logic looks simpler, this is extremely basic aspect of implementing cost savings. Wondering how? Well, Non production workloads are not expected to run always and hence those can be always stopped and started on weekdays when team or developers actually need

For example, let us say, I am running 1 c5a large instance, as per above architecture
Ec2 Run Time: 24*30(let us assume 30 days a month running for 24 hours) = 720 hours of EC2/RDS uptime
Team/Developer work time: 4 weeks(a Month timeline) * 40(5 days, 8 hours a week) = 160 Hours
Idle time = 720–160 = 560 Hours

What if I told, that you can save up on 560 idle hours? let see with real estimate now

Image description

AWS online pricing calculator, takes 730 hours for a month and estimates 112.42/month cost for c5a.xlarge instance usage. So if we stop & stop for 730–160 hours, 570 hours of savings is almost 78% will be $87.7 in savings per month and stand to pay $24.72. Isnt this huge? After all, money saved is money earned

To add up, please see the estimate of Amazon RDS(MySQL) cost for a month, without opting for Proxy usage, Single Zone, Opted out RDS Insights

Image description

Idea is to emphasize the importance of potential of implementing this cost saving during the design phase of architecting cloud solutions. In a improvised design, we can opt for reserved/savings plan instances and we will see about those enhancements & various other scenarios, in the upcoming posts 

Happy learning !!

Warp.dev image

Warp is the #1 coding agent.

Warp outperforms every other coding agent on the market, and gives you full control over which model you use. Get started now for free, or upgrade and unlock 2.5x AI credits on Warp's paid plans.

Download Warp

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Create a simple OTP system with AWS Serverless cover image

Create a simple OTP system with AWS Serverless

Implement a One Time Password (OTP) system with AWS Serverless services including Lambda, API Gateway, DynamoDB, Simple Email Service (SES), and Amplify Web Hosting using VueJS for the frontend.

Read full post

👋 Kindness is contagious

Discover fresh viewpoints in this insightful post, supported by our vibrant DEV Community. Every developer’s experience matters—add your thoughts and help us grow together.

A simple “thank you” can uplift the author and spark new discussions—leave yours below!

On DEV, knowledge-sharing connects us and drives innovation. Found this useful? A quick note of appreciation makes a real impact.

Okay