If you’re using AWS ECR (Elastic Container Registry) and ECS (Elastic Container Service), you probably love the scalability and flexibility. But let’s be honest—AWS can get expensive if you’re not careful. 💰
Good news! You can save a lot of money with a few smart strategies.
In this post, I’ll show you 5 practical tips to reduce your AWS costs when using ECR and ECS.
(👉 Prefer video? Watch the full breakdown here: YouTube Video)
Let’s dive in!
1️⃣ Clean Up Old Images in ECR Regularly
Problem:
Storing too many unused Docker images in ECR can quietly increase your storage costs over time. 😬
Solution:
Set up lifecycle policies to automatically delete old, untagged, or unused images.
✅ Quick Tip:
Keep only the last few versions of each image. For example, store just the last 3-5 versions.
👉 Benefit:
You’ll save on storage and keep your ECR clean and fast!
2️⃣ Use Fargate Spot for ECS Tasks
Problem:
Standard Fargate tasks can be expensive, especially for workloads that can tolerate interruptions.
Solution:
Use Fargate Spot for non-critical or batch jobs. Fargate Spot can be up to 70% cheaper than regular Fargate! 🔥
✅ Quick Tip:
Ideal for background tasks, data processing, or temporary jobs that can handle being stopped and restarted.
👉 Benefit:
Massive cost savings with minimal changes to your architecture.
3️⃣ Use EC2 Spot, Saving Plans, or Reserved Instances (If You Use EC2 in ECS)
Problem:
Running ECS services on EC2 with only On-Demand instances is one of the fastest ways to overspend. 💸
Solution:
Use Spot instances for non-critical workloads, and combine them with Savings Plans or Reserved Instances for baseline capacity.
✅ Quick Tip:
- Spot: Up to 90% cheaper
- Savings Plan: Flexible and cost-effective for consistent usage
- Reserved Instances: Great for predictable, long-term workloads
👉 Benefit:
Optimizing EC2 pricing models can dramatically reduce your AWS bill.
4️⃣ Use Auto Scaling on ECS Services
Problem:
Running fixed-size ECS services can leave resources underutilized and waste money during low-traffic periods.
Solution:
Set up Auto Scaling for your ECS services to automatically adjust the number of running tasks based on CPU, memory, or custom metrics.
✅ Quick Tip:
Use CloudWatch alarms to scale up during peak times and scale down when demand drops.
👉 Benefit:
You only pay for what you need, exactly when you need it. 💡
5️⃣ Right-Size Your ECS Services
Problem:
Over-provisioned CPU and memory settings lead to paying for resources you don’t actually need.
Solution:
Monitor your services with CloudWatch and adjust CPU/memory reservations based on real usage.
✅ Quick Tip:
Start small, track performance, and scale up only if needed.
👉 Benefit:
You only pay for the resources you truly use. Simple, but super effective. 💪
🎥 Watch the Full Video
👉 See all the details step by step here: https://youtu.be/AtOXRT7q03M
🎱 Bonus: Leverage Graviton Processors (ARM Architecture)
Many teams use x86 instances by default, missing out on cheaper, more efficient options.
You can use AWS Graviton (ARM-based) instances for your ECS tasks.
Why? Graviton processors can cut costs by up to 40% and offer better performance-per-dollar.
Thanks for reading! 👋
If this post helped you, check out more articles on my blog and don’t forget to subscribe to my YouTube channel for more easy-to-apply AWS tips! 🚀