How much does it cost to run in Amazon ECS?

Amazon ECS is a container management service offered by Amazon Web Services. It allows users to run Docker containers in a highly scalable and fault-tolerant manner. Running your containers on this platform can be more cost effective than running them on traditional virtual machines due to Amazon ECS’ pay-as-you-go pricing structure.

What is ECS used for?

It handles the scheduling of your tasks to ensure they run as efficiently as possible, while providing high availability and fault tolerance.

ECS has the following benefits:

  • Easy to use — Users can create and manage clusters using simple APIs or tools like AWS CloudFormation templates and CLI commands.
  • Integrated with AWS — Running applications in ECS also provides you with automatic scaling, load balancing, and security features like IAM roles for your containers.
  • Secure — By isolating your application from other workloads running in your environment, ECS ensures that only those resources meant for it are accessible. This prevents other applications from accessing these resources without proper authorization (through role-based access control).
  • Reliable — The Docker engine is integrated into Amazon’s global infrastructure that provides high availability features such as auto healing if nodes go offline or get corrupted due to software malfunctioning or hardware failure. This also allows users to set schedules so that tasks are executed only when needed rather than at regular intervals thus reducing costs while ensuring reliability when required most by saving up costs during non-peak hours.

It takes a bit of planning and some calculations

Optimizing your Container Orchestration choices can have a significant impact on your monthly bill. You’ll need to make some decisions about the number of tasks and containers that you run, so that’s where it starts. The pricing is determined by the number of tasks and containers that you run in your cluster, but there are different ways to optimize ECS cost.

  • If you’re running lots of small Docker containers, think about running them as a single ECS task by using Docker Compose or Kubernetes Pod (or even CloudFormation). That way, instead of paying for each instance-based container, you pay only for one task.
  • Use Spot Instances sparingly if possible — they’re expensive! Spot instances let Amazon bid down prices for unused AWS resources based on how desperate customers are for those same resources at that time.

How much does it cost to run in Amazon ECS?

  • If you’re running one instance, it will cost $0.00/hr.
  • If you’re running two instances and they’re on a Standard T2 instance, it will cost $0.001 per hour.
  • If you’re running two instances and they’re on a T3 instance (which has more CPU), it will cost about $0.0015 per hour for those extra CPUs.

The above examples assume that your cluster is the default size of 3 instances and that you have an average of 2 containers per instance to run (which is what we recommend). But if your cluster has fewer or more than 3 instances or if your average number of containers per instance is lower or higher than 2 then those numbers might be slightly different!

How will I use it?

Before you start planning your cluster, you need to know what it will be used for and how. What are the expected workloads? How many containers and tasks are going on at any given time? How much growth is expected over time? Start by doing some research on the actual needs of your application so that you can size appropriately. This will help ensure that you don’t overspend unnecessarily.

As a very general rule of thumb, if you’re running less than 10 VMs with 10 tasks each (assuming standard 1GB VMs), then ECS might be more expensive than AWS Fargate/EC2 Container Service (ECS). If this sounds like your situation, then consider using Fargate instead — it’s more cost effective when it comes to small clusters!

How do I optimize my costs? What’s my spending budget for ECS?

As you’re calculating your costs, it’s important to keep in mind that your spending budget is the most important part of operating any business. And it’s not just a matter of dollars and cents — you also need to consider how much time and effort it will take to manage costs, as well as what kind of services you can get for the price.

To help you figure out how much ECS will cost your business, we’ll look at three kinds of factors:

  • The amount you spend on EC2 instances (which run your containers) and EBS volumes (which store data).
  • The amount you spend on container scheduling services like ECS or Kubernetes Engine (GKE)*. You pay for these in terms of number of containers managed by each service per minute; for example, if you have 100 busy containers running in GKE and then scale up so there are 200 total busy ones at any given moment, then this means there are 100 new instances managing those 200 containers. With ECS, one instance handles multiple tasks but they’re more isolated from each other than with GKE so there won’t be anywhere near as much overhead involved here when scaling up or down.


As you can see, it’s not that difficult to get a handle on how much your ECS costs. With the right tools and some planning ahead of time, you can optimize your spend and keep an eye on your bill. If you’re looking for more information about managing containers or other AWS services, check out our blog posts!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store