Monitoring
-
System monitoring: where to start when the server is slow
The order of checks for "the server is slow": CPU, memory, disk, kernel and network — what shows each resource.
8 minvmstattopfree -h -
Load average: how many tasks wait for the CPU and the disk
The average number of tasks running or waiting for a CPU (R) or for the kernel (D) over 1, 5 and 15 minutes.
12 minuptimenproccat -
stress-ng — timed load on the CPU, memory and disk
stress-ng puts load on the CPU, memory and disk for a set time — for experiments with load, OOM and disk I/O.
9 minstress-ng --cpustress-ng --vmstress-ng --hdd -
iostat and pidstat — which disk is busy and which process loads it
iostat shows disk load — requests, latency, %util; pidstat shows CPU, memory and disk usage per process.
8 miniostat -dxsyiostat -xpidstat -dl -
Memory and swap: free, available and the page cache
How to read free: used and free memory, the page cache and available; swap, a swap file and vm.swappiness.
11 minfree -hgrep -Eps -eo -
top — processes and load in real time
The top program refreshes the process list, CPU load, memory and load average every few seconds.
5 mintoptop -otop -u -
uptime, who, w — who is on the system and the load
Compare load average to the core count (nproc), not an absolute threshold — the three numbers mean nothing without it.
4 minuptimenprocw -
Redis — in-memory key-value store
Cache, queues, and sessions in RAM; KEYS * blocks the server on large databases — use --scan instead.
5 minredis-cli pingredis-cli inforedis-cli --bigkeys -
tcpdump — capturing and analyzing network traffic
Captures packets to diagnose "is traffic even arriving"; without -n it resolves every IP through DNS and slows down.
4 mintcpdump -ni -
watch — periodically repeat a command
Repeats a command every N seconds on one screen; without quotes, a pipeline goes to the shell, not the command.
3 minwatch -n1watch catwatch -
Prometheus — metrics collection
Collecting metrics with a pull model — targets, PromQL, exporters, alerts.
3 minpromtool checkcurl -
Grafana — dashboards
Visualizing metrics and logs — data sources, dashboards, variables, alerts.
4 minsystemctl statusss -tlnpgrafana-cli admin