サービス · Serverless · CLF-C02 の発展
AWS Fargate
Task sizes, storage, Fargate Spot, and when Fargate beats EC2 nodes.
このレッスンはまだ翻訳されていないため、英語で表示しています。
クラウドプラクティショナーで学んだこと
- Serverless containers for ECS and EKS.
- You pay for the CPU and memory a task asks for, while it runs.
- Use EC2 for GPUs or specific instance types.
0.25 vCPU
- 0.5 to 2 GB
1 vCPU
- 2 to 8 GB
4 vCPU
- 8 to 30 GB
16 vCPU
- 32 to 120 GB
| Task vCPU | Allowed memory |
|---|---|
| 0.25 vCPU | 0.5 to 2 GB |
| 1 vCPU | 2 to 8 GB |
| 4 vCPU | 8 to 30 GB |
| 16 vCPU | 32 to 120 GB |
概要
You choose a CPU and memory pair for the task, and only some pairs are allowed. Sizes run from 0.25 vCPU with 0.5 GB to 32 vCPU with up to 244 GB. Each task gets 20 GiB of ephemeral storage by default, which you can raise to 200 GiB. It is deleted when the task ends. For data that must last or be shared, mount Amazon EFS.
Fargate Spot runs tasks on spare capacity at a lower price, and it can stop a task with a two-minute warning. Use it for fault-tolerant, stateless work such as queue workers. Mix it with normal Fargate in a capacity provider so a base of tasks stays up.
概要
Choose Fargate for the least operations work, for spiky or small loads, and for isolated tasks. Choose EC2 nodes for GPUs, tasks above 32 vCPU or 244 GB, custom AMIs, or the lowest cost at steady high use with Savings Plans.
覚えること
- Task size: 0.25 to 32 vCPU and 0.5 to 244 GB, in allowed pairs.
- Ephemeral storage: 20 GiB by default, up to 200 GiB, gone when the task stops.
- Shared or lasting files: mount Amazon EFS.
- Fargate Spot: cheaper, two-minute warning, for fault-tolerant tasks.
- No GPUs, no custom AMIs and no access to the host.
覚えること
- Steady, predictable high use can cost less on EC2 with Savings Plans.
試験では
- “Containers with the least operational overhead” points to Fargate.
- “Interruption-tolerant container jobs at the lowest cost” points to Fargate Spot.
- “Containers need GPUs” points to ECS or EKS on EC2, not Fargate.
- “Containers must keep data after the task stops” points to Amazon EFS mounted on the task.
混同しやすいもの
AWS LambdaSize memory, plan concurrency and cold starts, and know how each trigger calls a function.
Amazon Elastic Container Service (Amazon ECS)Choose Fargate or EC2, pick the right IAM role, and scale services behind a load balancer.
Amazon Elastic Kubernetes Service (Amazon EKS)Choose nodes, give pods their own IAM roles, expose them with a load balancer, and weigh ECS against EKS.