All ArticlesDevOps2026-11-28T12:28:54+08:00

VPS Feels Slow but CPU Usage Looks Low? Check Steal Time in top

Your VPS responds slowly even though your processes use little CPU, and the cause can sit outside your guest. You will learn what the %st steal time value in top means, how hypervisor overcommit and noisy neighbors raise it, and when the fix is to move to a different host or plan instead of tuning your app.

Your VPS feels sluggish. SSH lags when you type, pages take a second longer than usual, and cron jobs run late. You open top expecting a runaway process, but user and system CPU are low and nothing is near the top of the list. In that case, the number to look at is the one at the end of the CPU line, st. It measures time your virtual CPU wanted to run and the physical machine underneath did not let it.

This article explains where that number comes from, why it rises, and why tuning your application rarely fixes it.

What a vCPU actually is from the host's point of view

On a KVM-based VPS, which covers most VPS plans and Proxmox VMs, each virtual CPU you see inside the guest is a thread on the host. The host kernel schedules those threads the same way it schedules any other process. The default Linux scheduler places them on runqueues and gives them slices of real CPU time.

Providers usually sell more vCPUs than the host has physical CPU threads. This is called overcommit. It works because most VPS sit mostly idle, and their peaks rarely line up. When enough guests become busy at the same time, the host runqueues fill up. Your vCPU thread is ready to run, but it waits in line behind threads belonging to other guests. Those other guests are what people call noisy neighbors.

From inside your guest, this wait shows up as a gap. Your kernel was in the middle of running a PHP worker, the vCPU got descheduled on the host, and when it came back, wall-clock time had moved on. Your process did nothing during that gap. It did not run slowly. It did not run at all.

How the guest kernel learns it was paused

If the guest had no way to know about these gaps, it would charge the lost time to whatever happened to be running. Your process would look like it used more CPU than it did, or the time would vanish into idle. Steal accounting exists to fix that.

On KVM, the guest kernel and the hypervisor share a small per-vCPU memory area, the paravirtual steal-time structure. The guest registers it at boot through a model-specific register. The host then keeps a running total in it of how long that vCPU thread spent runnable but waiting for a physical CPU. The host already tracks this as the thread's run delay. Xen has a similar mechanism through its per-vCPU runstate information.

The update cycle works like this:

  1. The guest is running normally and the vCPU thread gets descheduled on the host because the runqueue is busy.
  2. The host scheduler counts the time the thread waits as run delay.
  3. When the vCPU is scheduled again, the host updates the shared structure with the new cumulative steal value.
  4. At its next timer tick or accounting point, the guest kernel reads the structure, compares it with the last value it saw, and attributes the difference to steal instead of to the current task.
  5. That total lands in the eighth column of the cpu lines in /proc/stat, which is where top, vmstat, and mpstat read it from.

The %st shown by top is not a direct measurement by top itself. It is the change in that /proc/stat counter between two refreshes, expressed as a share of total time. If the hypervisor does not expose a steal clock, or the guest kernel does not use it, the counter stays at zero even when contention is heavy. A zero reading means either no steal or no reporting, so it is weaker evidence than a high one.

Containers are different. An LXC container or similar shares the host kernel, so no hypervisor sits between it and the CPU to steal time. The st value inside a container usually tells you little. Contention there shows up as processes waiting on the shared scheduler or hitting cgroup CPU limits.

Reading steal time without fooling yourself

The point-in-time view in top is easy to misread, because one refresh can catch a quiet moment. Watch it over several seconds and per CPU. Every command below is read-only.

# One snapshot of the summary lines from top (press 1 in interactive top for per-CPU rows)
top -b -n 1 | head -5

# Steal is the last column, 'st', one line per second
vmstat 1 10

# Per-CPU breakdown including %steal and %iowait (needs the sysstat package)
mpstat -P ALL 1 10

# Raw cumulative counters; steal is the 8th number after 'cpu'
grep '^cpu' /proc/stat

A guest under host contention often looks something like this:

Illustrative output format (values are made up and round):
%Cpu(s): 10.0 us,  5.0 sy,  0.0 ni, 55.0 id,  0.0 wa,  0.0 hi,  0.0 si, 30.0 st

In this example, user and system time are low and idle looks healthy. Almost a third of the time, the guest was ready to work and could not. That matches the reported symptom of a slow machine with low CPU usage.

Before blaming the host, rule out two other patterns that produce the same symptom.

The first is a single saturated core. As the Linux Server Idle But Slow write-up points out, one thread pinned at 100% on an 8-core server only shows as about 12% overall. Your app can still freeze if that thread is the one serving requests. The per-CPU rows in mpstat show this right away. One CPU will have very high %usr while the others are idle, and steal stays low.

The second is waiting on disk. High wa (iowait) means the CPU had nothing to run because processes were blocked on storage. That is a different queue on the host, and it calls for a different investigation. The article on high iowait in a Proxmox VM covers how to tell guest disk load from host storage contention.

A community thread on r/Hosting lists steal, iowait, and memory as the usual first checks for exactly this symptom. That order is sensible. Run free -h as well, so you do not miss a guest that is quietly swapping.

As a rule of thumb, a few percent of steal now and then is normal background on shared hardware. Sustained double-digit steal that lines up with the times users complain is the pattern worth acting on. That threshold is a heuristic. What matters more is whether steal rises at the same time as the slowness.

Why tuning the app does not help

When steal is the cause, your code is not too slow. It is not being run. Caching, query optimization, or more PHP-FPM workers do not change how often the host schedules your vCPU. More workers can even make it worse, because more runnable threads now compete for the same stolen time and each request waits longer.

Adding vCPUs is also not a sure fix on a contended host. Each extra vCPU is another thread that needs a turn on busy physical cores. Multi-threaded software can also lose time when one vCPU holding a lock is descheduled while the other vCPUs spin waiting for it. KVM has mitigations for this, but a host without spare capacity stays a host without spare capacity.

The fixes are on the infrastructure side:

  • Collect evidence first. Run mpstat -P ALL 1 or vmstat 1 during a slow period and save the output with timestamps. Support teams respond much faster to "steal sat around 30% between these times" than to "the server feels slow". From the support side, a steal capture taken at the right time is one of the most useful things a customer can attach to a ticket, because it points directly at host contention.
  • Ask your provider whether the VM can be moved to a less loaded host. Whether this is possible, and how it is done, depends on the provider.
  • If the workload needs steady CPU, consider a plan with dedicated or guaranteed vCPUs, if your provider offers one. Check the plan description for how CPU is allocated instead of assuming.
  • If you run the Proxmox host yourself, look at it from the other side. On the host, each VM is a QEMU process, and the second field of /proc/<pid>/schedstat for its vCPU threads is cumulative runqueue wait in nanoseconds.
# On the host: runqueue wait (2nd field, ns) for every thread of one QEMU process
# Replace 12345 with the PID of the VM's QEMU process
for t in /proc/12345/task/*/schedstat; do echo "t(cat "$t")"; done

Sample that twice a few seconds apart. VMs whose wait grows fastest are being starved. The usual host-side fixes are rebalancing VMs across nodes or reducing vCPU overcommit.

When a VPS feels slow but its own CPU usage is low, check st per CPU over at least several seconds before you touch the application. If steal is high and rises at the same time as the slowness, save the output, take it to whoever runs the host, and treat a move to a different host or plan as the real fix. If steal stays near zero, look at single-core saturation, iowait, and memory next.