Pcornel
Virtualization · Resource Management

CPU Limits

Cheat sheet · https://pcornel.dk/topic.php?topic=3612

Back to the Topic

Answer

A CPU limit caps how much CPU (in MHz or percent) a VM may use even when the host is idle. Limits are rarely needed and easily cause unexplained slowness and high ready time, so use them deliberately.

Remember

  • Limits apply even when idle.
  • Often forgotten after testing.
  • Ready time rises under a limit.

First checks

  • qm set <vmid> --cpulimit 2 — cap at 2 cores (Proxmox)
  • Set-VMProcessor <vm> -Maximum 50 — cap at 50 % (Hyper-V)
  • cat /sys/fs/cgroup/machine.slice/*/cpu.max — cgroup quota

Verify in this order

vCPU demand → limit → throttled

Where it usually breaks

First mismatch in management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back; preserve identity/native error/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3612

Confirmation

Confirm action

Continue?