Bitzu

SAA-C03 ยท Containers and microservices

Fargate versus EC2 capacity

Serverless containers on Fargate versus EC2 launch type or capacity providers: management effort, control, GPU needs and scaling.

Key points

  • AWS Fargate: serverless tasks or Pods with isolated kernel; no instances to choose, patch or scale; CPU and memory set per task.
  • Always awsvpc network mode: own network interface and security groups.
  • Fargate Spot: interruption-tolerant tasks at a discount, two-minute warning.
  • EC2 capacity: you manage instances; instance types, custom AMIs, GPUs, privileged containers (not on Fargate).
  • ECS Managed Instances: AWS manages EC2 capacity.

Source: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/capacity-launch-type-comparison.html

Practice questions

Single choice

What do you stop managing when you move ECS tasks from EC2 capacity to AWS Fargate?

  1. The task definitions that describe your containers
  2. The EC2 instances that host the containers
  3. The IAM roles your tasks use
  4. The CPU and memory each task needs
Show answer

Answer: B. The EC2 instances that host the containers

With Fargate you no longer provision, patch or scale the EC2 instances that host tasks. You still write task definitions, choose CPU and memory per task and set IAM and network permissions.

Select all that apply

Which capacity providers does Amazon ECS make available on every cluster without you having to create them?

  1. FARGATE
  2. An Auto Scaling group capacity provider
  3. FARGATE_SPOT
  4. An Amazon ECS Managed Instances capacity provider
  5. EC2_ON_DEMAND
Show answer

Answer: A. FARGATE, C. FARGATE_SPOT

FARGATE and FARGATE_SPOT exist for all accounts and only need to be associated with a cluster. Auto Scaling group and ECS Managed Instances capacity providers must be created by you, and EC2_ON_DEMAND is not a built-in capacity provider name.

True or false

You can request GPUs for an Amazon ECS task that runs on AWS Fargate by adding the gpu parameter to its task definition.

Show answer

Answer: False

False. The gpu parameter is listed as not valid for Fargate tasks. GPU workloads on ECS need EC2-based capacity with GPU instance types.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More SAA-C03 topics in this module