Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
The quick answer
Step by step
- Load and kernel messages — how busy, and did something break?
Load rising (1-minute > 15-minute) = it is getting worse now. Look in dmesg for Out of memory, I/O error, link down, blocked for more than 120 seconds.
- One overview with
vmstat 1 5:
| Column | Watch for |
|---|---|
r | More than the CPU count = CPU queue. |
b | Processes blocked on I/O (disk/NFS). |
si / so | Swapping in/out — memory is too small. |
us / sy | CPU used by apps / by the kernel. |
wa | Time waiting for disk. |
st | Stolen by the hypervisor (cloud VM). |
- CPU — all cores busy, or just one? Which process?
mpstat -P ALL 1 3
pidstat -u 1 3One core at 100 % and the rest idle = a single-threaded app at its limit.
- Disk —
%utilnear 100 and a highawait(ms per request) = the disk is the bottleneck:
iostat -xz 1 3
Device r/s w/s rkB/s wkB/s r_await w_await aqu-sz %util
sda 12 880 96 52000 4.1 48.3 41.2 99.6
pidstat -d 1 3pidstat -d shows which process reads/writes. Also check df -h (a full disk makes apps fail or retry).
- Memory:
free -h(availablesmall?),si/soin vmstat, OOM lines indmesg. - Network: throughput and errors per interface, TCP retransmits:
sar -n DEV 1 3
sar -n TCP,ETCP 1 3
ip -s link show eth0- If all resources look fine — the app is waiting: on the database (slow queries, locks), an external API, DNS, a full connection pool. Look at the app logs,
ss -tn state established(where it connects), and the database's own view (pg_stat_activity). - Keep history — the problem is often gone when you look.
sar(sysstat with its timer enabled) and Prometheus/node_exporter record it, so you can look at "yesterday 14:00".
Check that it worked
You can say which resource was full (or that the app waited on something), and which process caused it — with numbers. After the fix the same commands show normal values.
Common problems
| Problem | Cause | Fix |
|---|---|---|
iostat: command not found | sysstat not installed. | dnf install sysstat / apt install sysstat; systemctl enable --now sysstat for history. |
| High load, CPU idle | Processes in state D waiting for disk/NFS. | iostat, ps -eo state,pid,cmd | grep ^D; check storage. |
High st (steal) | Noisy neighbours or burst credits used up (cloud). | Other instance type/size. |
| Everything looks fine, users still wait | The app waits on the DB, an API or a lock. | App traces/logs, DB views; check connection pools. |
| Slow only at certain times | Backups, cron jobs, log rotation. | Compare with cron/timers; sar history at that time. |
| Restart "fixed" it | A leak or a stuck resource. | Find the cause before it comes back: memory trend, open files, connections. |
Go further
- Command pages: uptime, dmesg, top, free, ps, ss.
- Next how-tos: Check memory and CPU usage, Check disk space, See who is connected to a database, Monitor a Linux server with Prometheus, Change the priority of a process, Choose a performance profile with tuned.
- Learn it: RH134 — Find the load, RHCSA — tuned.
- Practise: Lab: troubleshooting drill.
1vmstat shows high wa and b, CPU mostly idle. What is the bottleneck?
The disk (or network storage) — processes wait for I/O.
2All resources look normal, but requests are slow. Where do you look next?
At what the app waits on: the database, external APIs, DNS, connection pools.