vCPU
AWS
Cloud Computing
Amazon EC2
Virtualization

What is vCPU in AWS

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

A vCPU in AWS is a unit of virtual compute capacity used to describe how much CPU an EC2 instance exposes. It is not a promise of a full physical socket or even always a full physical core; instead, it is the scheduling unit AWS uses to describe CPU resources for a given instance type.

The Short Practical Definition

For many x86-based EC2 instances, one vCPU corresponds to one hardware thread of a physical core when simultaneous multithreading is enabled. That is why two vCPUs often map roughly to one physical core with two threads.

But that rule is not universal across every architecture. For example, on AWS Graviton instances, the mapping differs because the underlying core design is different from classic x86 hyperthreaded assumptions.

So the right mental model is:

  • vCPU is the compute unit AWS publishes for an instance type
  • its relationship to physical cores depends on the processor family and architecture

Why AWS Uses vCPUs

Cloud customers need a portable way to compare instance sizes without caring about every motherboard detail in the host. vCPU counts make it possible to say things like:

  • 't3.small has 2 vCPUs'
  • 'c7g.2xlarge has more compute capacity than a smaller instance'
  • a workload that needs eight execution threads might start by testing an eight-vCPU instance

This abstraction helps with sizing, pricing, and autoscaling decisions.

vCPU Does Not Equal Performance by Itself

A common mistake is assuming that two instances with the same vCPU count will perform the same. They may not. Performance also depends on:

  • CPU generation
  • clock speed and turbo behavior
  • architecture such as x86 versus ARM
  • memory bandwidth
  • network and storage performance
  • whether the workload is single-threaded or highly parallel

That is why an older eight-vCPU instance and a newer eight-vCPU instance can behave very differently under the same application.

Interpreting vCPU for Real Workloads

If your application runs multiple worker threads, vCPU count is a useful starting point for estimating parallelism.

For example, a CPU-bound batch processor might roughly scale with the number of available vCPUs.

python
1import os
2from concurrent.futures import ThreadPoolExecutor
3
4
5def work(x):
6    return x * x
7
8workers = os.cpu_count()
9print("detected workers:", workers)
10
11with ThreadPoolExecutor(max_workers=workers) as pool:
12    results = list(pool.map(work, range(10)))
13
14print(results)

Inside an EC2 instance, os.cpu_count() typically reflects the exposed logical CPU count, which aligns with the instance's available vCPU view.

For single-threaded applications, however, more vCPUs may not help much at all. In that case, stronger per-core performance can matter more than raw count.

Hyperthreading and the Misleading Core Assumption

On many traditional x86 instances, two vCPUs may share one physical core through simultaneous multithreading. That means two vCPUs are not the same as two fully independent physical cores.

This matters for compute-heavy workloads such as numerical simulation, compilation, or video encoding. Those jobs can still benefit from extra threads, but the scaling is not always linear.

That is why capacity planning should always include benchmarking on the actual instance family you plan to run.

Instance Selection Example

Suppose you have an API service that is moderately CPU-bound and runs eight worker processes comfortably. An eight-vCPU instance is a reasonable first sizing candidate.

But if you then compare a general-purpose instance with a compute-optimized instance at the same vCPU count, the compute-optimized option may still win because the underlying processor and platform are better suited to CPU-heavy work.

That is the important lesson: use vCPU count as a starting filter, not as the only selection criterion.

CPU Options and Tuning

Some instance families let you control CPU options such as threads per core. This can matter for licensing, workload isolation, or performance tuning.

If your application behaves better with one thread per core rather than two threads sharing a core, those settings may be relevant. But that is an advanced tuning step after you understand the workload.

Common Pitfalls

A common mistake is reading vCPU as if it always meant physical cores. It usually does not.

Another issue is comparing instances only by vCPU count while ignoring generation, architecture, and memory behavior.

Teams also sometimes overprovision CPU because a service is actually bottlenecked on I/O, storage latency, or database round trips rather than compute.

Finally, do not assume an eight-vCPU ARM instance and an eight-vCPU x86 instance will behave identically. Benchmark the actual workload.

Summary

  • A vCPU is AWS's published unit of virtual CPU capacity for an instance.
  • On many x86 instances, one vCPU corresponds to one hardware thread, not necessarily one full core.
  • Equal vCPU counts do not guarantee equal performance across instance families.
  • Use vCPU count as a sizing starting point, then validate with benchmarks.
  • Architecture, generation, and workload type matter as much as the raw vCPU number.

Course illustration
Course illustration

All Rights Reserved.