7

I have a question regarding cost structure on AWS ECS. How can I know which service on a container is "spending" the most? I don't see an option to tag containers. Any ideas are welcome, I didn't find any good solution off AWS websites. Thanks in advance.

David Mao
  • 71
  • 2

2 Answers2

1

ECS services are allocated to instances based on the memory limits and CPU units that you specify for the tasks that compose that service. You can estimate costing by dividing the cost the EC2 instances in your cluster by the total amount of resources divided by the amount of required resources.

CPU units are a minimum value, that is, a task won't be placed on an instance unless there are a minimum of CPU units available. Tasks can exceed the number of CPU units that they require, and the value can even be set to 0.

Memory limits are the maximum amount of memory that a task will be allowed to use. You must allocate enough memory to an ECS task, or it will be killed by ECS when it exceeds it.

Therefore, memory is a better resource to use when estimating costing.

For example:

Lets say you have a service that runs 2 instances of a task that requires a total of 800 MB of memory. If you are using t2.medium instances in your cluster, this service will require roughly 1/2 of a t2.medium to run, and your cost for this service on ECS will be 1/2 of of the cost of a 2.medium EC2 instance.

Josh Vickery
  • 862
  • 7
  • 10
  • 1
    Could you please provide an example with actual numbers? Effective Jan 7, 2019 AWS Fargate—the compute engine for ECS—has [reduced costs](https://aws.amazon.com/about-aws/whats-new/2019/01/announcing-aws-fargate-price-reduction-by-up-to-50-/). What does this mean for a small-size set-up in terms of monthly cost? A practical example like running a [LAMP stack on ECS](https://serifandsemaphore.io/how-to-host-wordpress-like-a-boss-b5993fcfbd8e) would likely yield the most benefit. – vhs Feb 12 '19 at 05:03
0

AWS provides a reporting tool called Cost Explorer that you can use to analyze the cost and usage of your Amazon ECS resources.
The following is an example of some of the fields that you can use to sort cost allocation data in Cost Explorer.

  • Cluster name
  • Service name
  • Resource tags
  • Launch type
  • AWS Region
  • Usage type

More details - https://docs.aws.amazon.com/AmazonECS/latest/userguide/usage-reports.html

K_at_play
  • 21
  • 3