Monitoring queries on a dedicated server are getting slower, yet CPU utilization is nowhere near full capacity. Adding worker threads at this point may only increase contention. Disk waits, memory reclaim and CPU queueing can all drive up latency; load average alone cannot tell you which is responsible. Linux PSI records how long tasks are stalled by resource shortages, helping you identify where they are waiting before deciding what to change.
1. Check the observation scope and kernel support
This article uses Debian 12. All the steps read metrics without changing kernel parameters. A NodeAMD dedicated server can host multiple self-managed services in one place, but having exclusive access to the server’s resources does not eliminate contention between services. Backups, index builds and live queries can still affect one another.
After payment, retrieve your credentials from the control panel, log in over SSH, then run these checks:
uname -r
findmnt -t cgroup2
ls -l /proc/pressure
cat /proc/pressure/cpu
cat /proc/pressure/memory
cat /proc/pressure/io
The three files report CPU, memory and I/O pressure respectively. If they are missing, first check whether the running kernel supports PSI, whether PSI is enabled and whether boot parameters have disabled it. Missing metrics do not mean there is no pressure. Visibility may also differ inside containers, so run whole-server diagnostics on the host system.
Before sampling, also record request volume, concurrent tasks and the periods when slow requests occur. Without workload context, a pressure graph shows only that tasks spent time waiting; it does not prove that a particular process caused the problem.
2. Understand some, full and cumulative counters
Each line contains avg10, avg60, avg300 and total. The first three are smoothed pressure percentages over their respective timescales. They are useful for spotting trends, but are not statistics for strictly bounded time slices. The last field is cumulative stall time in microseconds.
some means that at least some tasks are stalled on that resource. For memory and I/O, full measures time when all non-idle tasks are stalled simultaneously, usually indicating a broader impact on the system’s ability to make progress. Neither value is a task count, and the two must not be added together.
System-level CPU full has no meaningful interpretation for whole-server diagnostics and may appear as zero on some kernels. Do not use that to rule out CPU contention. For CPU pressure, focus on some and examine it alongside the run queue.
PSI measures time spent waiting for resources, not how busy the hardware is. High CPU utilization with low pressure may simply mean work is progressing continuously. Rising pressure despite modest utilization can also indicate contention in part of the system or resource limits.
Cumulative total values cannot be plotted directly as current pressure percentages. They grow over time: calculate the difference between two samples, then divide by the actual elapsed time. Establish a new baseline after a reboot or when the object being monitored is recreated.
3. Use fixed intervals for comparable readings
The following script uses the system’s existing Python 3 installation to sample ten seconds within a single session. It uses a monotonic clock so that system clock adjustments do not affect the denominator. The output is the stall percentage over that interval, not a copy of avg10.
from pathlib import Path
import time
def snapshot():
result = {}
for resource in ("cpu", "memory", "io"):
path = Path("/proc/pressure") / resource
for line in path.read_text().splitlines():
kind, *fields = line.split()
values = dict(field.split("=", 1) for field in fields)
result[(resource, kind)] = int(values["total"])
return result
start = time.monotonic_ns()
before = snapshot()
time.sleep(10)
after = snapshot()
elapsed_us = (time.monotonic_ns() - start) / 1000
for key in sorted(before.keys() & after.keys()):
delta = after[key] - before[key]
if delta < 0:
raise RuntimeError("Pressure counter reset")
percent = delta / elapsed_us * 100
print(f"{key[0]} {key[1]} {percent:.2f}%")
Reading the files sequentially introduces a small timing skew, so avoid attaching too much precision to short-interval results. Keep several samples of equal duration under normal load, under the problematic load and after making an adjustment, and correlate them with service latency. Ten seconds is only an example sampling interval, not a standard alert window.
If pressure spikes only briefly, check whether the spike coincides with a task starting. If it stays elevated across several intervals, move on to cross-checking the relevant resource. Do not create uncontrolled load on a production server just to produce a more obvious graph.
4. Cross-check the evidence for each resource
CPU: check queues and quotas
Run vmstat 1 10. Ignore the first data line, which reports averages since boot, and examine the subsequent r values and CPU states. Persistently rising CPU some together with a backlog of runnable tasks supports a diagnosis of scheduling contention, but you still need to check whether only a subset of cores is congested.
If the service runs in a cgroup, also read its cpu.stat and cpu.max. Throttling counters that increase during the problem period may indicate that the service is hitting its own quota, even while the server still has idle capacity. PSI is not a substitute for throttling counters and cannot, on its own, establish whether more cores are needed.
Memory: check reclaim, not just free memory
When memory pressure rises, examine swap-in and swap-out activity in vmstat alongside interval deltas for the scanning and reclaim counters in /proc/vmstat. Low free memory does not necessarily mean a memory shortage, because file cache can be reclaimed. Sustained direct reclaim, however, can increase request latency.
An absence of swap activity does not rule out memory pressure either. In particular, if a service has a memory limit, inspect the corresponding cgroup’s memory.events to distinguish server-wide pressure from the service reaching its own limit.
I/O: check latency and access patterns
If sysstat is installed, use iostat -xz 1 10 to observe device latency, queues and throughput. When I/O pressure rises alongside device latency, correlate the increase with backups, synchronous writes or bulk scanning tasks.
Do not interpret a single device’s utilization as direct proof that NVMe has reached its limit. Low throughput does not rule out a bottleneck either: small synchronous writes can be latency-bound. PSI I/O pressure does not mean insufficient network bandwidth.
5. Narrow the scope to a service and retest
With cgroup v2, use systemctl show -p ControlGroup --value 服务单元名 to find the service’s cgroup path, then read cpu.pressure, memory.pressure and io.pressure in that directory. Replace the service-unit placeholder in the command with the actual unit name. If the unit is not running or the relevant accounting is not enabled, check visibility first.
If host pressure is low but service latency is high, continue investigating service quotas, thread locks and external dependencies rather than concluding that the application is healthy. In virtualized environments, also distinguish between host and guest observations: host PSI may not fully explain waits inside the guest.
Change only one variable when retesting—for example, reduce background scan concurrency—then repeat the sampling at a similar request volume. Alongside falling pressure, check that request throughput is maintained, tail latency improves and background tasks still complete. Pausing all work must not be mistaken for a successful optimization.
Finally, retain the kernel version, observation scope, sampling interval, task concurrency, pressure counter deltas and service latency. Alert thresholds should come from real baselines and require both sustained pressure and an impact on the service, rather than applying a universal percentage. The goal of diagnosis is a reproducible chain of cause and effect, not a graph that merely looks stable.
Frequently asked questions
Is a PSI percentage the same as CPU or disk utilization?
No. PSI measures the share of time tasks stall for a resource, not hardware utilization. Correlate it with CPU run queues, device latency, memory reclaim and swap activity.
Does a zero full value mean the service is unaffected?
No. some can already indicate delays affecting part of the workload. System-level CPU full is not a basis for diagnosing CPU contention; check service latency and its cgroup pressure too.
NodeAMD EPYC 7543P dedicated server, from $439/month