Finding Where a Proxmox VM Is Slow: A Dig-Down
"The VM is slow" is the least informative sentence in a ticket: slow on CPU, memory, or disk IO each demands a different fix, and tuning in the abstract is mostly wasted effort. This article is not a symptom-branch decision tree. It is a plane-by-plane dig-down: the CPU plane reads steal time and core overcommit, the memory plane reads the ballooning threshold, and the disk IO plane reads raw passthrough and virtualization-layer overhead. Each plane gets a host-side and a guest-side cross-read so that "which layer is slow" is settled before any change is made.
I once debugged a VM that was stuck even though the host still had half its CPU free, and the answer was that steal time had been taking all of the vCPUs' work away. I have also debugged a ballooning min set so low that the host kept the guest pinned in swap. The difference between a connectivity problem and a performance problem is this: a connectivity failure is a break, a performance problem is a queue. Decide which queue it is in before deciding how to shorten the queue. External references: the Proxmox performance tuning guide, the Linux top man page, and the Linux iostat man page.
One tooling caveat up front, because it is the biggest Proxmox-versus-VMware trap:
esxtop is a VMware ESXi-only tool and does not exist on Proxmox (Proxmox VE runs on
KVM/QEMU and has none of the ESXi host toolchain). To look at a single VM's resources from
the host side, the most reliable move is to read the QEMU process for that VM (a
qemu-system-x86_64 process whose command line carries guest=vm-<id>), stacked on top of
the overall host load. Community tools such as proxtop or virt-top can give a prettier
per-VM view, but they are third-party additions, not part of Proxmox, so do not depend on an
extra tool during an incident. And steal time is only visible inside the guest's
top/vmstat - it is counted by the guest kernel itself, and there is no per-VM steal
column to read on the host. Every host-side command below follows that convention.
A first layered health check: assign the slowness to a plane
Do not change any setting yet. Pull three readings. The host side looks at this VM's QEMU process and the overall load; the guest side looks at itself. Only when the two sides line up do you know where the bottleneck really is:
# host side: this VM's CPU allocation, cores, cpuflags, memory/balloon, data-disk format
qm showconfig 100 | grep -E "^cores:|^cpu:|^memory:|^balloon:|^scsi|^virtio"
# host side: find this VM's QEMU process (on KVM, the per-VM view is ~ this process)
pgrep -af "qemu-system.*100"
# host side: this QEMU process's CPU use (the closest thing to a per-VM CPU view on the host)
pidstat -p <PID> 1 5
# host side: how much host capacity is left, any cross-socket NUMA
uptime
mpstat -P ALL 1 5
# guest side: top's us / sy / wa / st columns (st = steal, the key one, only here)
top -bn1 | head -15
# guest side: vmstat's si / so / wa / st
vmstat 1 5
# guest side: iostat's await and %util (high %util + high await = a real IO bottleneck)
iostat -xz 2 3
Reading baseline (recognize the fields before drawing conclusions):
- the guest's
topst(steal) persistently above 5 percent: the CPU plane is being squeezed by the host, plane 1; - the guest's
vmstatsi/sononzero withwaspiking: the memory plane is under pressure, plane 2; - the guest's
iostat%utilnear 100 withawaitclearly raised: the IO plane is queuing, plane 3; - all three low: the bottleneck is mostly in the application's own logic or an external dependency, not the virtualization layer.
A judgment I hold: I read the guest's top and the host's QEMU process together. Reading
the guest's top alone makes it easy to misread "the host is not giving cores" as "the
application pegs the CPU." A high us and a high st look alike but demand opposite
fixes. Cross-reading both sides is the biggest difference between performance and
connectivity debugging.
Plane 1: CPU - steal time and core overcommit
Steal time is a KVM-specific metric: the guest wanted the vCPU to run, but the host,
because of overcommit or a noisy neighbor, withheld the physical core, and that interval
is recorded as st inside the guest. A high steal is not the guest's application; it is
the host not handing over cores. Note: it is only counted inside the guest kernel; the
host has no per-VM steal column to read (the biggest difference from ESXi, so do not go
hunting for it the way you would with esxtop).
# host side: how many vCPUs this VM has, whether the host CPU model is passed through
qm showconfig 100 | grep -E "^cores:|^cpu:"
# host side: overall host load (confirm real overcommit: load against core count)
uptime
# host side: how much CPU this VM's QEMU process is using now (high = running, low but guest stuck = cores stolen)
pidstat -p <PID> 1 5
# guest side: confirm steal is persistent, not an instantaneous blip
top -bn1 | grep -E "^%Cpu|st"
How to dig further:
- the guest's
stpersistently high and the host's load-to-core ratio above 1: cores are overcommitted. Too many vCPUs on one physical core, so everyone waits. Lower this VM's cores, pin it to idle physical cores (taskset/numactl), or cut the VM count on this host - pick one, do not leave all three untouched. stnot high butushigh and thecpumodel not passed through: probably missing cpuflags. Some workloads (databases, crypto libraries) probe for specific instruction sets; KVM does not pass through the full host feature set by default, so a missing flag routes them to a slow path. Enablecpu: hostor setcpuflagsexplicitly to pass the needed features through so the guest uses the host's real capabilities.stis an instantaneous blip andusis flat: a neighbor's periodic job is likely stealing the core. Isolate it withtasksetpinning, observe for a while, and leave the cores alone.
I hit one (a scenario built from a typical production case): a database VM slowed down in
bursts through the night, and top's us looked "not full," so I first blamed the
application's GC. Only after watching the st column did I find a neighbor's backup job
taking the physical cores for twenty minutes every hour. The fingerprint of steal is
"periodic, in sync with a host neighbor's job" - watching us alone never finds it.
Plane 2: memory - ballooning threshold and the guest driver
Ballooning lets the host "reclaim or return" guest memory on demand: it reclaims when the host is tight and returns when it is idle. The mechanism saves resources, but a wrong threshold turns the saved resources into guest stutter.
# host side: this VM's memory cap and balloon min (the min is the key)
qm showconfig 100 | grep -E "^memory:|^balloon:"
# host side: this VM's QEMU process's actual memory use (changes as ballooning reclaims/returns)
ps -o pid,rss,vsz -p <PID>
# guest side: is swap being forced by host-side memory pressure
free
# guest side: is the ballooning driver / QGA installed (if not, the host cannot reclaim or return)
qga-ping && echo "QGA OK" || echo "QGA not responding, check guest agent install"
How to dig further:
- the
balloonmin set below the floor the application actually needs: the host pins the guest to that min for long stretches, the guest is forced into swap, and any busy workload stutters. Raise the min to the floor the application genuinely needs; do not squeeze it to fit one more VM. - the guest's
freeswap in/out persistently nonzero: the memory is being pressed. Confirm whether ballooning is the cause: on the host,psshows whether this QEMU process's RSS is pinned near the min. qga-pingunresponsive / QGA missing: the host can neither reclaim nor return, memory management goes one-way, and the symptom is "ballooning configured but no effect." Install the QEMU guest agent before discussing the threshold.
A candid note: there is no universal formula for the ballooning threshold. The min depends on the application's own memory behavior, and that part can only be set by load testing and observation. Most of the stutter I have seen is not a mechanism problem but a min guessed too low.
Plane 3: disk IO - raw passthrough and virtualization-layer overhead
In local-directory and bare-disk scenarios, the disk IO bottleneck is rarely the disk itself; it is the virtualization-layer format of the data disk.
# host side: this VM's data-disk format (raw or qcow2) and storage
qm showconfig 100 | grep -E "^scsi|^virtio"
# host side: IO latency on the host's raw disk / storage (iostat the raw disk, closer to the physical disk than the VM)
iostat -xz 2 3
# guest side: await and %util, judge whether the disk is queuing
iostat -xz 2 3
# guest side: for a precise latency distribution, run blktrace (costly, short window)
blktrace -d /dev/vda -o - | blkparse -i - | head -30
How to dig further:
- the guest's
%utilnear 100 withawaitclearly raised: IO really is queuing. First separate a slow disk from format overhead: under the same load, raw is usually a notch faster than qcow2. - the data disk is qcow2 and the load is sequential block writes: qcow2's COW and format parsing eat time. For local-directory / bare-disk scenarios that value stable IO, I default to raw; keep snapshot needs in a separate policy rather than making the data disk carry qcow2.
awaithigh but%utilnot high: not queuing, probably one large IO with high latency. Runblktraceto see the latency distribution and locate which segment of IO is slow.
I worked through one (a scenario built from a typical production case): a log-writing VM
moved from qcow2 to raw, and the guest's await fell from double digits to single digits
while the host's %util on the same raw disk barely changed. The whole difference was the
qcow2 virtualization layer. The disk did not get faster; the path got shorter.
The three planes together: a misdiagnosis quick table
| Guest-side signal | First guess (misread) | Real plane | Where to look |
|---|---|---|---|
top st persistently above 5 percent |
the application pegs the CPU | CPU overcommit / noisy neighbor | host load + cores + QEMU process |
us high but not full, periodic |
application GC | cpuflags not passed through | qm showconfig cpu: |
vmstat swap in/out nonzero |
application memory leak | ballooning min too low | qm showconfig balloon: |
| ballooning configured but no effect | threshold not applied | QGA / driver missing | guest qga-ping |
iostat %util near 100 |
disk failing | real queueing | await + data-disk format |
| raw a notch faster than qcow2 | different disks | qcow2 virtualization overhead | data-disk format |
This is the "what performance slowness is most often misdiagnosed as" table in working form. Performance tickets start as "the machine is laggy" or "the application is slow"; reading the planes backwards avoids repeatedly tuning the wrong layer.
The question I ask before touching anything
Before I change anything I ask: is this VM slow because the host is not handing out
resources, or because the guest is queuing on its own? Read the guest's
top + vmstat + iostat against the host's QEMU process and overall host load, and which
of the three planes is queuing becomes clear. A high steal is the host's account,
ballooning is the threshold's account, a high await is the IO's account - the three
accounts' fixes do not overlap, and if you judge wrong, every later tweak is a guess.
A judgment I stand by: avoid overcommit if you can, and prefer raw over qcow2 (for
local-directory / bare-disk scenarios). Keep ballooning, but give the min headroom. In
performance problems, "save resources" and "keep it stable" often fight, and my order is
stability first: the few cores and bytes of memory saved do not come close to covering a
ticket about an application slowing down at 3 a.m. And one more reminder: do not hunt for
esxtop on a Proxmox host - that is an ESXi thing. On KVM, the per-VM view lives on the
QEMU process, and steal lives in the guest's top.
Frequently asked questions
Q: The guest's top shows a persistently high steal. What is taking the CPU?
A: Steal is the time the guest wanted the vCPU to run but the host withheld a physical
core, so the root is host overcommit or a noisy neighbor. Steal is only readable inside
the guest's top or vmstat; on a KVM host there is no per-VM steal column. On the host,
pgrep the VM's QEMU process, pidstat its CPU, then read uptime and mpstat for the host's
remaining capacity. A persistently high steal basically confirms overcommit: lower this
VM's cores, pin it to idle cores, or reduce the VM count on this host, and consider
cpuflags passthrough so missing features do not slow the workload.
Q: I enabled ballooning and the VM got slower. Is ballooning at fault?
A: Usually the min is set too low. Ballooning lets the host reclaim and return guest
memory on demand; with a min below what the application actually needs, the host pins the
guest near that floor and the guest falls into swap, so any busy workload stutters. Read
the balloon min in qm showconfig, then watch the guest's free for swap in/out. Set the min
to the floor the application genuinely needs; do not squeeze it to fit one more VM.
Q: Under the same load a VM on a raw disk is clearly faster than one on qcow2. Why?
A: The difference is virtualization-layer overhead. qcow2 pays a format-parse step on every
read and write and may trigger COW and compression; raw is close to a direct write and
skips that layer. For local-directory and bare-disk scenarios I default VMs to raw: I give
up snapshot and compression convenience in exchange for a stable IO path. If you need
snapshots, build a separate snapshot policy instead of making the data disk carry qcow2.
Q: How do I tell whether the slowness is on the host or inside the guest?
A: Cross-read. On the host, pidstat the VM's QEMU process CPU and iostat the raw disk's IO
latency; inside the guest, read top, vmstat, and iostat for us, st, wa, and await. If the
host QEMU process CPU is low but the guest's us is high, the guest's own application is the
issue; if the host's overall st or wa is high, the bottleneck is the host or a noisy
neighbor. If neither side lines up, look at the IO scheduler or the qcow2 virtualization
layer eating time.
Q: The host looks idle, yet the VM is slow. How?
A: "The host is idle" does not mean "the cores or IO assigned to this VM are idle." NUMA
affinity may be unset and the vCPUs may be scheduled across sockets, or several VMs may
share one raw disk and a neighbor's IO has filled the queue. The host QEMU process CPU and
the raw disk's await say more about where the real bottleneck sits than "host idle rate"
does.
Related
- Linux CPU monitoring: the five top fields - the general method for reading top's columns inside a guest
- Linux disk IO monitoring - reading await, %util, and queue depth in full
- Linux memory monitoring - the baseline for judging swap and memory water level
- Proxmox VM cannot reach the network: a triage tree - the sister piece: the connectivity plane (the opposite of slowness)
Originality note: Every command, the layered read method, and the case studies in this article were compiled by the author from performance troubleshooting on Proxmox VE (KVM/QEMU) in production. Commands are labeled for host-side versus guest-side context. esxtop belongs to VMware ESXi and does not exist on Proxmox; all host-side per-VM readings here fall back to the QEMU process, and steal is read in the guest's top. The case studies are built from typical production scenarios and contain no real company names, IP addresses, or timelines.