Use it when a system or application is slow without a clear error.
Performance Troubleshooting
Performance troubleshooting finds the resource that limits a workload — CPU, memory, disk I/O or network — using the USE method: utilisation, saturation and errors for each resource.
1. uptime and vmstat 1 — run queue, swap, wa?
2. CPU: mpstat -P ALL 1; memory: free -h.
3. Disk: iostat -xz 1 (await, %util).
4. Network: sar -n DEV 1 and ss -ti retransmits.
5. Compare with a baseline; fix the saturated resource.
workload → each resource checked for utilisation, saturation and errors → bottleneck → fix → measured improvement
For Linux Troubleshooting → Performance Troubleshooting, continue with the first unproven Topic check: Define workload, concurrency, latency/throughput/error acceptance criteria and a comparable baseline. If that boundary is healthy, advance to the adjacent check: Capture time-aligned CPU/run queue, memory pressure, storage latency/queue, network loss/retransmits and application queue/lock evidence. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
vmstat 1 5Primary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
Healthy evidence: the workload has a defined baseline/SLO, time-correlated evidence identifies the limiting boundary, a targeted change shifts the expected metric and end-to-end latency/throughput improves without correctness regression.
Step 2 Command read-back and what it shows Verify boundary
Verification must discriminate state rather than merely show that a command ran. With vmstat 1 5, known-good means the relevant pressure indicators remain near the known-good baseline while the original workload meets its latency/throughput objective; known-broken/suspicious means sustained run-queue, blocked-task, swap or I/O-wait pressure coincides with the reproduced slowdown and persists after the supposed fix. vmstat 1 5 is a short host-wide pressure sample; it does not identify the responsible process, device or remote dependency and cannot show absence of intermittent problems. Repeat the original acceptance case after the minimal approved change.
Step 3 Commands Verify boundary
uptime ; vmstat 1 5
iostat -xz 1 3
sar -q 1 5
Step 4 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Define workload, concurrency, latency/throughput/error acceptance criteria and a comparable baseline.
- Capture time-aligned CPU/run queue, memory pressure, storage latency/queue, network loss/retransmits and application queue/lock evidence.
- Locate the first saturated/queued dependency and verify causality with controlled change or workload shaping.
- Repeat the same workload, compare before/after distributions and check correctness, resource headroom and regressions.
Step 5 Failure modes and next checks Narrow the fault
Suspicious evidence: random tuning is applied before baseline capture, averages hide tail latency, utilization is confused with saturation, or synthetic benchmark gains are accepted without original workload verification.
Step 6 Observation-driven branch and next-check logic Narrow the fault
Reproduce the smallest original Linux Troubleshooting → Performance Troubleshooting case and record vmstat 1 5 before change. Choose the next check from the observation: if run queue and user/system CPU stay high, identify CPU consumers and limits; if blocked tasks/I/O wait dominate, move to device/filesystem/backend latency; if swap/reclaim rises, inspect memory consumers and cgroup/host pressure; if all samples look normal, capture during the original slowdown and inspect application latency. Compare a known-good peer/revision where useful and stop once the earliest failing step is identified.
Step 7 Common mistakes Narrow the fault
- Tuning before identifying the bottleneck.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Measure before changing anything. Check each resource with one tool (vmstat, iostat, sar, ss) and compare with a baseline. Fix the first saturated resource.
journalctl -b -p err— errors this bootsystemctl --failed— failed unitsdf -h; df -i— space and inodesss -tulpn— listening socketsdmesg -T | tail— recent kernel messages
ReferenceWhat it is1 section · depth on demand
Core model
Begin with a reproducible workload and baseline. Separate demand, utilization, saturation, queueing and errors at each resource; use time-aligned system and application metrics to find the first constrained boundary and test one hypothesis at a time.
ReferenceHow it works1 section · depth on demand
How it works
Linux Troubleshooting → Performance Troubleshooting is a state pipeline rather than one command outcome. The responsible state is scheduler run queues, CPU time classes, memory/reclaim/swap state, blocked tasks and storage I/O wait observed over the same workload interval. Linux performance emerges from contention across CPU scheduling, memory pressure and I/O; short samples reveal which resource class is currently accumulating wait but must be correlated with the workload and process/device-level evidence; meanwhile application concurrency, cgroup limits, NUMA placement, filesystem/cache behavior, hypervisor contention and backend latency can produce similar system-level pressure signals. Boundary distinction: high load average is not synonymous with CPU saturation, and a single quiet sample does not disprove intermittent pressure outside the capture window.
ReferenceImportant terms & boundaries4 sections · depth on demand
What this shows and what it does not
Performance Troubleshooting owns cross-resource symptom isolation; Processes, Storage, Networking, Containers/Virtualization and application branches own deep remediation once bottleneck is localized.
In depth
Performance troubleshooting: finding the bottleneck
"The server is slow" means some resource is saturated, or some task is waiting. The first job is to find which one. The kernel's pressure stall information (PSI) measures exactly that waiting. /proc/pressure/cpu, memory and io each report two values:
- some: the share of time at least one task was stalled on the resource.
- full: the share of time all non-idle tasks were stalled at once, which the documentation calls thrashing.
Each comes as averages over 10, 60 and 300 seconds, plus a total. The same files exist per cgroup, so pressure can be measured per service or container.
The USE method: utilisation, saturation, errors
| Resource | Utilisation | Saturation | Errors |
|---|---|---|---|
| CPU | top, mpstat -P ALL 1 | Load above the CPU count; vmstat r; PSI cpu | — |
| Memory | free -h, /proc/meminfo | Swap activity (vmstat si/so); PSI memory | OOM kills (dmesg) |
| Disk | iostat -x 1 %util | aqu-sz, await; PSI io | I/O errors (dmesg) |
| Network | sar -n DEV 1, ip -s link | Drops, retransmits (nstat) | Interface errors |
A first minute on a slow host
| Command | Looking for |
|---|---|
uptime | Load trend (1, 5, 15 minutes) |
cat /proc/pressure/* | Which resource tasks are waiting for |
vmstat 1 5 | r, b, si/so, wa, st |
iostat -xz 1 3 | Busy or slow devices |
top (sorted by CPU, then memory) | Which processes use it |
dmesg -T | tail | OOM, I/O errors, throttling |
ss -s | Connection counts |
host$ cat /proc/pressure/cpu /proc/pressure/memory /proc/pressure/io
some avg10=1.20 avg60=0.95 avg300=0.80 total=81232011
full avg10=0.00 avg60=0.00 avg300=0.00 total=0
some avg10=0.00 avg60=0.02 avg300=0.01 total=1203321
full avg10=0.00 avg60=0.00 avg300=0.00 total=983211
some avg10=42.10 avg60=38.70 avg300=21.40 total=912339201
full avg10=35.80 avg60=31.20 avg300=17.90 total=771203312
host$ iostat -xz 1 2 | grep -E "Device|sdb"
Device r/s w/s rkB/s wkB/s r_await w_await aqu-sz %util
sdb 12.0 1480.0 96.0 94720.0 3.10 48.20 71.30 99.8
host$ sudo iotop -oPa -n 3 -b | head -5
host$ cat /sys/fs/cgroup/system.slice/postgresql.service/io.pressure
Reading the example
CPU and memory pressure are negligible. I/O pressure is high, and "full" at about 35 % means that for a third of the time, all active tasks were waiting for I/O at once. iostat points at sdb, with long write waits and a deep queue. The cgroup's own pressure file shows which service is affected, and iotop shows who is writing.
Documented example, not captured output.
How it works at runtime
Performance Troubleshooting is part of Linux Troubleshooting → Performance Troubleshooting. Performance Troubleshooting isolates Linux latency, throughput or saturation problems by defining an SLO/workload and correlating CPU, memory, storage, network, scheduler and application queues rather than tuning a single metric.
Topic-specific state model. Performance Troubleshooting isolates Linux latency, throughput or saturation problems by defining an SLO/workload and correlating CPU, memory, storage, network, scheduler and application queues rather than tuning a single metric.
Interpretation rule. - High utilization ≠ saturation or user-visible bottleneck.
- Low CPU ≠ system has spare capacity when storage/network/locks are bottlenecked.
- One benchmark ≠ production workload behavior.
- A tuning change improving one metric ≠ end-to-end performance is improved safely.
Method
Linux performance troubleshooting with the USE method — for each resource check Utilisation, Saturation, Errors:
| Resource | Utilisation | Saturation | Errors |
|---|---|---|---|
| CPU | mpstat -P ALL 1 | load vs cores, vmstat r column, PSI cpu | perf/MCE logs |
| Memory | free -h | swapping (vmstat si/so), PSI memory | OOM kills |
| Disk | iostat -xz 1 %util | aqu-sz, await, PSI io | dmesg I/O errors |
| Network | sar -n DEV 1 | drops, ss -ti retransmits | ip -s link errors |
cat /proc/pressure/{cpu,memory,io}
sar -A -f /var/log/sa/sa05 # historical (sysstat)
PSI (pressure stall information) directly shows time tasks spent waiting for each resource.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Performance Troubleshooting owns cross-resource symptom isolation; Processes, Storage, Networking, Containers/Virtualization and application branches own deep remediation once bottleneck is localized.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Linux Troubleshooting → Performance Troubleshooting. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.kernel.org/ · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Performance Troubleshooting operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Performance Troubleshooting.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Performance Troubleshooting isolates Linux latency, throughput or saturation problems by defining an SLO/workload and correlating CPU, memory, storage, network, scheduler and application queues rather than tuning a single metric. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin symptom + exact time + host/boot/user → define scope + expected baseline → preserve original failing test → collect targeted kernel/process/service/storage/network/security/log evidence → identify first divergent boundary → make one minimal reversible change → repeat original test → verify adjacent regressions and retain before/after evidence. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | symptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture check | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Performance Troubleshooting troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux troubleshooting evidence can establish this proof path: symptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture check | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured host, boot, process/user, dependency, time or workload scope. Performance Troubleshooting troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven boundary: reproduce the exact original failure, collect the owning subsystem evidence at the same time, change only the proven cause or prerequisite, then repeat the original workload and regression checks. | Continue to the next unresolved boundary while preserving the original test condition. |
Performance Troubleshooting · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Performance Troubleshooting |
|---|---|
| Topic path | Linux Troubleshooting → Performance Troubleshooting |
| Runtime state | Performance Troubleshooting isolates Linux latency, throughput or saturation problems by defining an SLO/workload and correlating CPU, memory, storage, network, scheduler and application queues rather than tuning a single metric. |
| Fast checks | - Define workload, concurrency, latency/throughput/error acceptance criteria and a comparable baseline. - Capture time-aligned CPU/run queue, memory pressure, storage latency/queue, network loss/retransmits and application queue/lock evidence. - Locate the first saturated/queued dependency and verify causality with controlled change or workload shaping. - Repeat the same workload, compare before/after distributions and check correctness, resource headroom and regressions. |
| Verification chain | symptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture check Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | Performance Troubleshooting troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |