Every slow VPS you have ever debugged was slow for one of four reasons: CPU runnable but starved, memory reclaimed under you, I/O waiting, or something downstream sitting on the network. Load average tells you that something is happening. Pressure Stall Information tells you what work was actually prevented from running, and for how long. On a cgroup v2 system it costs one file read and no agents.
PSI is the metric that answers the question your users are really asking — “how much of my request time was spent waiting rather than working” — and it does so without you having to build a model of what normal looks like first.
What the files contain
Three resource types are exposed: cpu, memory, and io. Each lives at /proc/pressure/<resource> system-wide, and per-cgroup at /sys/fs/cgroup/<path>/<resource>.pressure. Confirm PSI is compiled in before relying on it:
cat /proc/pressure/cpu
# some avg10=3.21 avg60=1.88 avg300=1.02 total=18493022
cat /proc/pressure/io
# some avg10=0.00 avg60=0.14 avg300=0.05 total=902133
# full avg10=0.00 avg60=0.09 avg300=0.03 total=611884
zcat /proc/config.gz 2>/dev/null | grep PSI
Two lines per resource, and the difference between them is the whole point of the interface. some means at least one task was stalled. full means every non-idle task was stalled — the machine, or the cgroup, was doing no useful work at all. The values avg10, avg60, avg300 are percentages of wall time spent in that state, exponentially weighted. total is cumulative microseconds since boot.
Note that cpu has no full line. That is deliberate: if any task is running, the CPU is not fully stalled. CPU pressure is always expressed as some.
| Reading | Meaning | Act on it when |
|---|---|---|
cpu some avg60 | Some task wanted CPU and waited | >20% sustained |
memory full avg60 | All work blocked on reclaim | >2% — any full stall is serious |
io full avg60 | All work blocked on disk | >5% sustained |
io some vs full gap | Partial blocking, queue still draining | Gap >10× — queue depth issue |
Reading it without a monitoring stack
For a one-off triage, a loop is enough. This prints the three pressure files every two seconds with a timestamp, which is all you need to catch a spike while you are logged in:
while true; do
printf '%s ' "$(date +%H:%M:%S)"
awk '/^some/{printf "cpu=%s ",$2}' /proc/pressure/cpu
awk '/^full/{printf "mem=%s ",$2}' /proc/pressure/memory
awk '/^full/{printf "io=%s\n",$2}' /proc/pressure/io
sleep 2
done
Per-cgroup readings are more actionable on a shared box because they isolate the offender. If your web stack runs under a systemd slice, read its pressure file directly — no cgroup v1 hierarchy walking, no controller mount guessing:
cat /sys/fs/cgroup/system.slice/php8.3-fpm.service/cpu.pressure
cat /sys/fs/cgroup/system.slice/php8.3-fpm.service/io.pressure
systemd-cgtop -m --iterations=5
systemd-cgtop gives you a live table of CPU, memory and I/O per unit, which is usually faster than constructing the paths by hand.
Correlating with steal and load
The single most useful correlation on a VPS is PSI CPU pressure against steal time. Both describe waiting for CPU, but they have different owners. Steal is time your vCPU was runnable while the hypervisor ran somebody else — the delay is outside your control. PSI cpu some rises when your own tasks contend with each other. If cpu some is high and steal is flat, you are oversubscribed on your own vCPUs and adding a vCPU or fixing the workload will help. If steal is high and cpu some is low, your requests are throttled at the host layer and no amount of tuning inside the guest will fix it.
vmstat 1 10 | awk 'NR>2{print "steal="$15" us="$13" sy="$14}'
grep '^some' /proc/pressure/cpu | awk '{print $2,$3,$4}'
The second correlation worth building is load average versus io some. A load of 12 with io some avg10 at 40% is an I/O queue problem, and the fix is storage or write pattern, not CPU. A load of 12 with memory full above zero is reclaim — the box is thrashing and every process is paying for it. Watching these together removes most of the guesswork from “the site is slow”.
Thresholds that actually mean something
Percentages are meaningless without duration. A single 30-second full stall during a backup is fine; 3% sustained over an hour is a user-visible problem. Set alarms on the avg300 window for stability, and on avg10 for urgency. Suggested starting points, adjusted for a 2–4 vCPU guest:
# alert definitions, Prometheus-style thresholds
# cpu_some_avg10 > 25 for 10m -> resize or find the busy loop
# mem_full_avg10 > 0.5 for 5m -> reclaim storm, check swap and cache
# io_full_avg10 > 8 for 10m -> storage tier problem
# steal_pct > 5 for 15m -> host contention, open a ticket
The memory one deserves an explanation. memory full above zero means every runnable task was blocked in reclaim at the same instant. Even one percent is an enormous amount of stalled time at scale, because each stall is tens of milliseconds of direct reclaim. Treat any sustained non-zero value as an incident rather than a warning.
Using PSI to size before users notice
The value of PSI over a simple load threshold is that it degrades gracefully with capacity. On a 4 vCPU guest, cpu some avg10 climbing from 8% to 25% over a fortnight is a clean trend line that says “you are 60% of the way to a resize” without a single slow page view yet. That is the window where a plan change is cheap and uneventful, before the first p99 spike forces an emergency migration.
If you are establishing baselines on a new machine, the VPS sizing and plan breakdown on virtualserversvps.com is worth matching against your measured steady-state PSI numbers — a plan whose vCPU count keeps cpu some under 10% at your normal load has headroom for the next growth step.
Two honest caveats. PSI measures stalling, not slowness — a fast SSD with a short queue can show low io full while individual requests are slow, so pair it with latency percentiles from the application. And on container guests, the host may expose /proc/pressure read-only or restrict per-cgroup paths; if the file is missing, check memory.max and cpu.max at the cgroup root instead and treat them as your ceiling.
Set the three alerts, keep a weekly avg300 chart, and the conversation about scaling stops being reactive. That is most of the practical benefit — the rest is tuning by evidence instead of by feel.



Leave a Reply
You must be logged in to post a comment.