Interview Prep/AWS/Cost Optimization

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.

aws All AWS questions Roadmap: Cloud cost & architecture

More on Cost Optimization