Use this when deciding how many vCPUs a VM should have and how they map to physical cores and threads.
vCPU · Hypervisor Architecture
A vCPU is a virtual processor presented to a VM and scheduled by the hypervisor onto physical cores or threads. Give a VM only as many vCPUs as it uses, because extra vCPUs add scheduling overhead and ready time.
1. A vCPU is a host thread scheduled on physical cores.
2. Give the fewest vCPUs that meet demand.
3. Too many vCPUs increase co-scheduling wait.
4. Watch CPU ready/steal.
5. Topology (sockets/cores) matters for licensing and NUMA.
vCPU thread → hypervisor scheduler → physical core
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Validate CPU changes with the original workload Verify boundary
After resizing or changing CPU policy, confirm the guest sees the expected processor topology and that the hypervisor reports normal scheduling delay for the VM. Run the same application workload and compare throughput, latency and guest CPU saturation against the prior baseline. Check host contention to ensure the improvement is not achieved by moving the problem to neighboring VMs. Where NUMA matters, confirm the VM fits the intended topology and memory locality. A lower guest CPU percentage can simply mean slower scheduling; a lower ready time can still coexist with application serialization. The operational evidence is improved workload behavior with acceptable host-side scheduling state.
Step 2 Differentiate guest demand from host scheduling delay Narrow the fault
If a VM reports high CPU, determine whether the guest is actually consuming execution time or waiting to be scheduled. Host metrics such as ready time, co-stop or platform-equivalent scheduling delay help identify contention that guest Task Manager or top cannot see directly. If only one workload thread is saturated, more vCPUs may not help because the application lacks parallelism. If latency worsens after increasing vCPU count, inspect NUMA placement and scheduler contention instead of assuming the guest needs still more CPU. Also verify power-management, affinity and reservation/limit settings that can constrain execution. Correlate measurements to the same time window and workload before changing VM sizing.
Step 3 Common mistakes Narrow the fault
- Assigning more vCPUs than needed (scheduling overhead).
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Start small; add vCPUs when proven needed.
- More vCPUs = more scheduling wait.
- Licensing may count vCPUs.
virsh vcpuinfo <vm>— vCPU to pCPU mapping and stateGet-VMProcessor <vm>— Hyper-V vCPU count and settingsqm config <vmid> | grep -E 'cores|sockets|cpu'— Proxmox vCPU config
ReferenceWhat it is1 section · depth on demand
vCPU scheduling and topology exposure
A vCPU is a schedulable virtual processor presented to a guest, not a permanently dedicated physical core unless the platform is explicitly configured for that model. The hypervisor schedules vCPU execution onto physical CPUs while preserving guest architectural state. VM topology—sockets, cores, NUMA exposure and affinity—can influence how the guest scheduler and applications place work. Adding vCPUs increases potential parallelism but also increases scheduling coordination and can make a VM harder to schedule under contention. CPU overcommit is therefore an allocation policy, not a direct performance guarantee. Always separate configured vCPU count, guest utilization and host-side scheduling delay.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
In hypervisor architecture, a vCPU is a thread of execution that the hypervisor scheduler runs on a physical core or hyperthread when the VM has work. vCPUs are not tied to physical cores unless you configure pinning or reservations.
| Mechanism | Effect |
|---|---|
| Scheduler | Time-slices vCPUs across physical CPUs |
| Hyperthreading | Two logical CPUs per core; adds ~10–30% throughput, not double |
| CPU pinning/affinity | Fixes vCPUs to specific physical CPUs |
| Reservations/shares/limits | Guarantees, priorities and caps |
| Latency sensitivity | Dedicated cores for real-time workloads |
Scheduling cost grows with VM size: a VM with many vCPUs needs several physical CPUs free at roughly the same time. Contention appears as CPU ready (VMware), CPU wait time (Hyper-V) or steal time (KVM guests).
virsh vcpupin app01
virsh schedinfo app01
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Hypervisor Architecture → vCPU. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/docs.html · confidence 94%