A vCPU (virtual central processing unit) is a virtual processor representing a time slice of a physical CPU core or thread, allocated by a hypervisor to a virtual machine. Rather than existing as dedicated hardware, it is a software-defined unit of compute capacity scheduled onto underlying physical silicon (pCPUs). This abstraction allows multiple isolated virtual machines or containers to share a single physical host simultaneously.
How it works
The hypervisor's CPU scheduler divides physical processor cycles into rapid time slices and assigns them to waiting vCPUs. On modern server processors with Simultaneous Multithreading (SMT) or Intel Hyper-Threading enabled, a single vCPU typically maps to one logical hardware thread rather than an entire physical core. On ARM-based hosts or systems with SMT disabled, one vCPU generally corresponds directly to one physical core.
- Resource pooling: Physical threads form a shared compute pool that the hypervisor distributes dynamically across active guests.
- Granular scaling: Operators can assign exact vCPU counts to match application requirements and adjust them through configuration changes without touching physical hardware.
- Context switching: When a vCPU finishes its time slice or waits on I/O, the hypervisor saves its state and loads another vCPU onto the physical thread.
Example
Suppose a bare-metal host has 2 physical sockets, each with 8 physical cores and Hyper-Threading enabled, providing 32 logical threads in total. In a multi-tenant cloud or virtualization cluster, an administrator might provision 96 vCPUs across several virtual machines—a 3:1 vCPU-to-thread overcommit ratio.
In a KVM/libvirt domain XML definition, assigning 4 vCPUs to a guest looks like this:
<domain type='kvm'>
<name>app-worker-01</name>
<vcpu placement='static'>4</vcpu>
<cpu mode='host-passthrough'/>
</domain>
If all guests demand heavy compute simultaneously, vCPUs must wait in a queue for an available physical thread. On Linux guests, you can check this contention using vmstat 1 and inspecting the st (steal time) column, which shows the percentage of time a vCPU waited for the hypervisor to schedule it.
What matters when choosing a server or hosting
- Dedicated vs. shared vCPUs: Shared plans overcommit physical threads across neighbors, causing variable latency during peak traffic. Dedicated vCPU tiers pin virtual processors to specific physical threads for predictable throughput.
- Underlying processor architecture: A vCPU on a modern high-frequency core outperforms a vCPU on older hardware. Check whether the provider uses x86_64 (AMD EPYC, Intel Xeon) or ARM (AWS Graviton, Ampere) and verify whether a vCPU represents a thread or a full physical core.
- Burstable credit limits: Entry-level cloud instances often throttle CPU speed once a baseline utilization threshold is exceeded and accumulated CPU credits run out.
Common mistakes
- Treating 1 vCPU as 1 physical core: Because most x86 providers map 1 vCPU to 1 hyperthread, two vCPUs usually equal one physical core—not two independent cores.
- Over-allocating vCPUs to a single VM: Assigning more vCPUs than an application can parallelize forces the hypervisor to wait until multiple physical threads are simultaneously free (co-scheduling), increasing
CPU Readylatency. - Ignoring CPU steal time: High application latency on a lightly loaded VM often points to noisy neighbors on an oversubscribed host rather than a bug in your code.
FAQ
Is 1 vCPU equal to 1 physical core?
Usually no. On x86 servers with Hyper-Threading or SMT enabled, 1 vCPU maps to 1 logical thread, meaning 2 vCPUs share 1 physical core. On ARM servers without SMT, 1 vCPU typically equals 1 full physical core.
What is CPU overcommitment?
CPU overcommitment is the practice of assigning more total vCPUs across virtual machines than the host has physical threads. Light web workloads tolerate ratios like 3:1 or 4:1 well, while latency-sensitive databases perform best at 1:1.
How many vCPUs does a web server or database need?
Small web applications, reverse proxies, and APIs often run well on 1 to 2 vCPUs. Production relational databases and background worker queues typically require 4 or more dedicated vCPUs to handle concurrent queries and indexing without contention.