- Newest
- Most votes
- Most comments
Hi,
Is it a real requirement for you to run with ECS on your own EC2 instances? If not, I would suggest to switch to Fargate, which is the serverless version of ECS. It will handle scaling, placement, HA, etc. for you.
So, less "heavy lifting" on your side.
See https://aws.amazon.com/fargate/
Additionally, for some use cases, Fargate may prove cheaper then EC2: it depends on the utilization of your instances. See this blog post for some calculations to see which one is better: https://aws.amazon.com/blogs/containers/theoretical-cost-optimization-by-amazon-ecs-launch-type-fargate-vs-ec2/
Best,
Didier
All containers in a task are run on the same host. If you want to spread those 9 containers over both hosts, you should put them into minimum of 2 tasks, or have task per container if it doesn't make difference where individual container is run (same or different host).
The task definition is a document that describes what container images to run together, and what settings to use when running the container images.
See https://docs.aws.amazon.com/AmazonECS/latest/bestpracticesguide/application.html
Relevant content
- asked 2 years ago
- App with 2 microservices - should they run in two ECS clusters or two services in single ECS clusterAccepted Answerasked a year ago
- Accepted Answerasked 4 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 21 days ago
- AWS OFFICIALUpdated 2 years ago
Hi @Didier_Durand, Thanks for answering for my question If we pick fargate launch type then it will be very expensive. That's because we pick EC2 instead of fargete
Fargate calculation
Pricing calculations 30.42 tasks x 2 vCPU x 720 hours x 0.04048 USD per hour = 1,773.22 USD for vCPU hours 30.42 tasks x 4.00 GB x 720 hours x 0.004445 USD per GB per hour = 389.42 USD for GB hours 20 GB - 20 GB (no additional charge) = 0.00 GB billable ephemeral storage per task 1,773.22 USD for vCPU hours + 389.42 USD for GB hours = 2,162.64 USD total Fargate cost (monthly): 2,162.64 USD