AWS › AWS Fargate

How does resource sizing work for a Fargate task, and what CPU and memory combinations are supported?

Intermediate

Answer

Fargate requires you to specify a task level CPU and memory allocation from a defined set of supported combinations, such as a quarter vCPU paired with a range of memory options between half a gigabyte and two gigabytes, and choosing the right size directly affects both performance and cost, so it is important to right size based on your application's actual resource usage rather than over provisioning unnecessarily.
{
  "cpu": "512",
  "memory": "1024",
  "containerDefinitions": [...]
}
Real-world example A development team monitors their Fargate task's actual CPU and memory utilization using CloudWatch, then reduces their task definition's allocated resources after discovering the application was significantly over provisioned, immediately lowering their monthly Fargate costs.

Common follow-ups: What happens if a Fargate task exceeds its allocated memory limit?;How granular are the available CPU and memory sizing options?