Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

CPU Shares

Direct answer

CPU shares set a VM's relative priority only when the host is contended: a VM with twice the shares gets about twice the CPU. Shares have no effect on an idle host and are inherited relative to resource pools.

When to use this

Use this when deciding which VMs win CPU under contention.

First 30 seconds

1. Shares set relative priority only under contention.

2. No effect when the host is idle.

3. Higher shares for important VMs.

4. Shares are relative to siblings.

5. Prefer shares over limits.

Operational verification

contention → shares ratio → CPU time

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Setting all VMs to High (no effect relative to each other).
  • Ignoring shares on resource pools when VMs inside get less than expected.
  • Expecting shares to help without contention.
Platform / version applicability
virtualization
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformvirtualization
Scope / prerequisiteUse this when deciding which VMs win CPU under contention.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

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.

observation · 1
Key points
  • Shares are relative weights, not guaranteed amounts.
  • They only matter while the host is contended.
  • VMs in a pool share the pool's allocation.
Key checks
  • qm set <vmid> --cpuunits 2048 — weight (Proxmox; default 100 cgroup v2)
  • Set-VMProcessor <vm> -RelativeWeight 200 — Hyper-V weight
  • virsh schedinfo <vm> --set cpu_shares=2048 — libvirt
ReferenceWhy it matters1 section · depth on demand

Values

Level (vSphere)Shares per vCPU
Low500
Normal1000
High2000

Shares are relative and only apply under contention. In resource pools the pool's shares are split among its VMs, so a pool with 50 VMs at High can give each VM less than a lone VM at Normal in another pool. KVM equivalent: cpu.weight (cgroup) / cpuunits in Proxmox.

ReferenceImportant terms & boundaries3 sections · depth on demand

In depth

Shares are weights, only under contention

CPU shares decide how host CPU time is divided when VMs compete; an idle host lets any VM use what it needs. The libvirt domain format documents <cputune><shares> as a relative weight whose range depends on cgroups v1 or v2.

PlatformSettingDefault
Proxmox VE--cpuunits100 with cgroup v2 (1024 on old cgroup v1 hosts)
libvirt<cputune><shares>N</shares></cputune>Derived from vCPU count on older libvirt; 100 under cgroup v2
vSphereShares Low/Normal/High (500/1000/2000 per vCPU)Normal

Worked example under contention

Host with 8 cores fully busy, three VMs each wanting all of it:

VMcpuunitsShare of CPU time
db01400400 / 600 = 67 %
app0110017 %
batch0110017 %

Shares vs. limits vs. pinning

ToolProxmox / libvirtEffect
Sharescpuunits / <shares>Relative priority only when busy
Limitcpulimit 2 / <period>+<quota>Hard cap (2 = two cores' worth) even when the host is idle
Pinningaffinity 0-3 / <vcpupin>Restrict to specific host CPUs

Limits cause latency at quota boundaries (throttling); prefer shares for prioritisation and limits only for noisy or untrusted workloads.

Verify on the host (cgroup v2)

cat /sys/fs/cgroup/qemu.slice/101.scope/cpu.weight
cat /sys/fs/cgroup/qemu.slice/101.scope/cpu.stat | grep throttled

Rising nr_throttled means a limit is actively slowing the VM — a frequent hidden cause of "the VM is slow but the host is idle".

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Equivalents on other platforms

PlatformSettingDefault
Hyper-VProcessor Relative weight (Set-VMProcessor -RelativeWeight)100 (range 1–10,000)
Proxmoxcpuunits (qm set 101 --cpuunits 200)100 on cgroup v2
libvirt<cputune><shares>Depends on cgroup version

As on vSphere, these weights only matter when the host CPU is contended.

Worked example

CPU shares (weights) only matter when CPUs are contended: each VM gets CPU proportional to its shares among competing VMs.

PlatformSettingDefault
VMwareLow/Normal/High = 500/1000/2000 per vCPUNormal
Hyper-VRelative weight 0–10000100
Proxmoxcpuunits (cgroup v2 weight 1–10000)100

Worked example: two VMs compete for one core, VM A has 2000 shares and VM B 1000 → A gets about two thirds of the time, B one third. When B is idle, A can use the full core.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docvirtualization current

Authoritative/upstream documentation reviewed for bounded claims in Resource Management → CPU Shares. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://libvirt.org/html/libvirt-libvirt-domain.html · confidence 94%
Confirmation

Confirm action

Continue?