How do you choose between Fargate and EC2 for containers on cost?
IntermediateProductionCost Optimization
Answer
Fargate charges per vCPU and GB per second with no idle node capacity and no node management, so it wins for small, spiky or low-utilization workloads. EC2 (with good bin packing, Spot and Savings Plans) wins for large steady fleets where you can drive node utilization above roughly 60 to 70 percent. Include people cost: patching and scaling nodes is not free. Fargate Spot gives a large discount for interruptible ECS tasks.
More on Cost Optimization
Where do you start when asked to cut an AWS bill?BeginnerCompute Savings Plans vs EC2 Instance Savings Plans vs Reserved Instances?IntermediateHow do you size a Savings Plans commitment?AdvancedWhere is Spot a good fit and where is it not?BeginnerHow do you configure an ASG for Spot reliability?IntermediateHow do you rightsize EC2, RDS and containers?Intermediate