AWS
Fargate
vCPUs
Cloud Computing
Containerization

What vCPUs in Fargate really mean?

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Amazon Fargate, a serverless compute engine for containers offered by AWS, abstracts away the need to manage infrastructure, simplifying container management and allowing developers to focus on building applications. However, understanding Fargate's virtual CPUs (vCPUs) is crucial for maximizing efficiency and ensuring your applications perform optimally. In this article, we delve into what vCPUs in Fargate really mean, including technical explanations and useful examples.

Understanding vCPUs in Fargate

Basics of vCPUs

In a traditional environment, CPUs refer to the physical processors in a computer. However, in cloud computing, and specifically in Amazon Fargate, the term vCPU (virtual CPU) is used to describe a unit of computing power. Each Fargate task or pod can be configured to use a certain number of vCPUs, providing predictable performance by specifying the amount of CPU resources allocated to your containers.

Fargate's vCPU Model

Amazon Fargate uses vCPUs as an abstraction of the underlying physical CPU. Here's how it's defined:

  • 1 vCPU: Represents a single hyperthread on a 2.5 GHz Intel Xeon Scalable processor (Skylake).
  • Provisioning: vCPUs in Fargate are provisioned in increments of 0.25, 0.5, 1, and up to the maximum available cores provided by the Fargate infrastructure.
  • Sharing and Isolation: Unlike traditional EC2 instances where multiple tasks might share a single host's CPUs, Fargate schedules tasks on isolated environments where the specified vCPUs are dedicated to your task.

vCPU Allocation

Allocating the right amount of vCPUs is critical to ensuring optimal performance and cost-effectiveness:

  • Under-provisioning: If you allocate fewer vCPUs than your application requires, it may lead to throttled performance, increased response times, or even dropped requests under load.
  • Over-provisioning: Allocating more vCPUs than needed increases costs without proportional performance benefits.

Example of vCPU Allocation

Consider a scenario where you have a batch processing application that typically consumes 1.5 vCPUs during peak load. In such cases, you might allocate 2 vCPUs to buffer occasional spikes, ensuring smooth performance:


Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.