How We Decreased Our Monthly AWS Costs from $10,000 to $1,500
Managing cloud infrastructure can quickly become costly if not optimized correctly. Our team recently embarked on a mission to reduce our AWS spending, successfully bringing it down from a staggering $10,000 per month to just $1,500. Here’s a detailed breakdown of how we achieved this significant cost reduction and the savings from each action.
I’d also like to mention Omer Haim for helping out, his tips were critical for cutting the costs so significantly.
1. Cleaning Up ECR Images
Problem
Our Elastic Container Registry (ECR) was storing Docker images for over a year. This accumulated unnecessary storage costs.
Solution
We implemented a lifecycle policy to automatically delete images older than 30 days.
Savings
- Before: $13/day
- After: $0.1/day
- Total Savings: $12.9/day (~$387/month)
2. Optimizing ECS Fargate Services
Problem
Our ECS Fargate services were over-provisioned, leading to high costs due to unused resources.
Solution
We performed a thorough analysis of our service utilization and right-sized our Fargate tasks. Additionally, we used Fargate Spot where possible.
Savings
- Before: $100/day (3 environments, 2 regions on production)
- After Optimization: $18/day
- After Using Fargate Spot: Below $10/day
- Total Savings: $90/day (~$2,700/month)
3. Managing S3 Bucket Storage
Problem
Our S3 buckets were filled with outdated and unnecessary data, and we had no expiration policies in place.
Solution
We audited our S3 storage and implemented lifecycle rules to delete or archive data after a certain period.
Savings
- Before: $450/month
- After: $180/month
- Total Savings: $270/month
4. Converting VPN Usage to Secure SSH Tunnel
Problem
We were heavily relying on VPNs for secure connections, which incurred higher operational costs.
Solution
We transitioned to using Secure SSH Tunnels for our secure connections.
Savings
- Before: $120/month per environment — $360/month
- After: Approximately $3/month
- Total Savings: $357/month
5. Right-Sizing RDS and DocumentDB Instances
Problem
Our RDS and DocumentDB instances were over-provisioned, leading to unnecessary high costs.
Solution
We evaluated the actual performance and usage metrics of our RDS and DocumentDB instances and right-sized them accordingly.
Savings
DocumentDB:
- Before: $40/day
- After: $8/day
- Total Savings: $32/day (~$960/month)
RDS (Postgres):
- Before: $12/day
- After: $4/day
- Total Savings: $8/day (~$240/month)
6. Purchasing ECS Savings Plans
Problem
We had no committed savings plans, resulting in higher on-demand pricing for our ECS services.
Solution
We purchased ECS savings plans tailored to our usage patterns.
Savings
- ECS Costs: Less than $9/day
- Total Savings: $6/day (~$180/month)
7. Consolidating Load Balancers
Problem
We were using multiple Elastic Load Balancers (ELBs) for different services, which led to increased costs.
Solution
We consolidated our load balancers by switching to a single Application Load Balancer (ALB) for our entire application.
Savings
- Before: $18/day
- After: Less than $1/day
- Total Savings: $17/day (~$510/month)
8. Removing Redundant IPv4 Addresses
Problem
We had multiple unused or redundant IPv4 addresses allocated, leading to unnecessary costs.
Solution
We conducted an audit of our allocated IPv4 addresses and identified those that were no longer in use.
Savings
- Before: $18/day
- After: Less than $2/day
- Total Savings: $16/day (~$480/month)
9. Removing a Redundant Environment
Problem
We had a redundant environment (alpha) that was incurring additional costs.
Solution
We removed the redundant alpha environment.
Savings
- Total Savings: $1,500/month
10. Right-Sizing Remaining Resources
Problem
Resources like ElasticCache, OpenSearch, and Redshift were over-provisioned, leading to high costs.
Solution
We right-sized these resources based on actual usage metrics.
Savings
- Total Savings: $400/month per environment (~$800/month in total)
Total Savings
Summing up the savings:
- ECR Images: $387/month
- ECS Fargate Services: $2,700/month
- S3 Buckets: $270/month
- VPN Costs: $357/month
- DocumentDB: $960/month
- RDS (Postgres): $240/month
- ECS Savings Plans: $180/month
- Load Balancers: $510/month
- IPv4 Addresses: $480/month
- Removing Redundant Environment: $1,500/month
- Right-Sizing Remaining Resources: $800/month
Total Monthly Savings: $8,384/month
Conclusion
By addressing these key areas, we successfully reduced our monthly AWS expenses from $10,000 to $1,500. These figures are rough numbers, but the general picture is clear: significant savings are achievable. This level of cost reduction is critical for startups, often making the difference between going big or going home. Regular audits and optimizations of cloud infrastructure are crucial in maintaining cost-effectiveness and ensuring resources are utilized efficiently.