Topic lessonTopic: Containers, ECS and Fargate
Fargate CPU and memory: units, valid combinations and sizing decisions
Fargate does not accept arbitrary CPU and memory combinations. First align units, supported pairs, OS and platform-version conditions. Then separate a supported configuration from evidence that it provides enough application performance.
Convert CPU units/vCPU and MiB/table GB, then check Linux examples against ranges, increments and platform conditions.
A task definition is a revision of execution settings. This exercise covers ECS Linux Fargate task-level sizing. It neither registers nor launches tasks or measures a real application; do not generalize Linux runtime enforcement to Windows.
Separate compatibility, provisioning and performance
- Compatibility check → Placement and launchA valid pair still needs launch conditions
- Placement and launch → Application measurementVerify performance even after launch
- Compatibility check
- OS, CPU, memory and platform
- Placement and launch
- Capacity, quota, IAM and connectivity
- Application measurement
- Load, latency and memory behavior
Provisioned size is configuration; usage is observed consumption. Configuring 1 vCPU does not establish continuous full utilization. More CPU also need not proportionally reduce latency when waiting on an external API or database is the limiting factor.
Normalize CPU units and memory units
| Setting | Conversion/example |
|---|---|
| CPU | 1024 CPU units = 1 vCPU; 512 units = 0.5 vCPU. |
| Numeric memory | The registered numeric value is MiB; 8192 MiB corresponds to 8 GB in this AWS table. |
| AWS table notation | Follow the documented table conversion: table GB × 1024 = MiB. |
| Other GB conventions | Do not mix this with decimal GB; verify the input and API units. |
{
"cpu": "1024",
"memory": "8192"
}S1 represents 1 vCPU and 8192 MiB, or 8 GB in this table. It does not mean 1024 CPUs or 8192 GB. These two fields also do not provide the OS, image, permissions, connectivity or other launch requirements.
Check Linux ranges and increments, not just upper bounds
| CPU units (vCPU) | Supported memory | Additional condition |
|---|---|---|
| 256 (0.25) | 512 MiB, 1 GB, 2 GB | Linux |
| 512 (0.5) | 1, 2, 3, 4 GB | Linux |
| 1024 (1) | 2–8 GB in 1 GB increments | Linux |
| 2048 (2) | 4–16 GB in 1 GB increments | Linux |
| 4096 (4) | 8–30 GB in 1 GB increments | Linux |
| 8192 (8) | 16–60 GB in 4 GB increments | Linux platform 1.4.0 or later |
| 16384 (16) | 32–120 GB in 8 GB increments | Linux platform 1.4.0 or later |
| 32768 (32) | 60, 120, 244 GB | Linux platform 1.4.0 or later |
| Case | Configuration | Table result |
|---|---|---|
| S1 | 1024 units / 8192 MiB | 1 vCPU / 8 GB is listed; launch and performance remain unverified. |
| S2 | 512 units / 512 MiB | 0.5 vCPU allows 1–4 GB, not 512 MiB. |
| S3 | 8192 units / 18432 MiB | 8 vCPU / 18 GB is inside the range but not a permitted 4 GB increment. |
| S4 | 32768 units / 61440 MiB | 32 vCPU / 60 GB is currently listed; check Linux platform and other conditions. |
Windows requires task-level CPU/memory settings, but those values do not enforce collective runtime limits on a container group in the same way as Linux. AWS points to container-level settings for Windows limits. This Linux summary is not a replacement for Windows-specific conditions.
Choose among supported sizes using measurements
- Review OS, architecture, platform version and required features.
- Normalize units and check supported ranges/increments.
- Account for the application, supporting containers and startup work.
- In an authorized environment, measure usage, latency and errors under representative load.
- Compare peaks, headroom, task count and cost, then remeasure changed settings under comparable conditions.
| Teaching assumption | Calculation and limitation |
|---|---|
| Three concurrent tasks, each sized as S1 | Total configured size is 3 vCPU and 24576 MiB (24 table GB). |
| Meaning of that sum | Not measured CPU utilization or requests per second. |
| Cost | Duration, OS, Region and supporting services are also needed. |
Check units, increments and the limits of the conclusion
Choose an option to see the result and explanation.
Check, then explain in your own words
- Convert the units in S1 and S4.
- Explain S2’s minimum and S3’s increments using the table.
- Identify measurements for your application and separate task size from task count.
Check your understanding: What remains after a Fargate size matches the table?
Platform applicability, actual launch conditions, application performance/health and cost review.
Accepted configuration, available resources and successful application behavior require separate evidence.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
- ECS invalid CPU or memory errorsChecked:
Scope and conditionsFargate combinations, MiB conversion, 32-vCPU and platform conditions; table membership is not launch success. Documentation review, not live AWS verification.
Used in this lessonSeparate compatibility, provisioning and performance Normalize CPU units and memory units Check Linux ranges and increments, not just upper bounds Choose among supported sizes using measurements Check units, increments and the limits of the conclusion
Scope and conditionsTask versus container settings, units and Windows runtime-enforcement differences. Documentation review, not live AWS verification.
Used in this lessonSeparate compatibility, provisioning and performance Normalize CPU units and memory units Check Linux ranges and increments, not just upper bounds Choose among supported sizes using measurements Check units, increments and the limits of the conclusion
- Amazon ECS servicesChecked:
Scope and conditionsDesired-count maintenance, replacement and throttled retries; no immediate-success or HTTP-health guarantee. Documentation review, not live AWS verification.
Used in this lessonSeparate compatibility, provisioning and performance
- AWS Fargate pricingChecked:
Scope and conditionsProvisioned resources, duration and platform conditions; separate surrounding charges and avoid fixed-price promises. Documentation review, not live AWS verification.
Used in this lessonChoose among supported sizes using measurements