Linux course index · Linux Advanced 2 category · Lesson 4 of 7
AI disclosure — AI-generated content, posted as is. AI can make mistakes. This extension adds new material and links related posts from this site. The newly written explanations and examples may be freely reused. Linked source material retains its own terms.
Learning goal
Use related signals to decide whether to investigate CPU, memory, disk I/O, or an application bottleneck.
Concepts and setup
The archive introduces free, vmstat, top, and process inspection. This lesson adds Pressure Stall Information (PSI), when the kernel exposes it. PSI reports when tasks are delayed by scarce CPU, memory, or I/O. A resource can be busy without causing observable stalls, and a stalled request can involve more than one resource. Ignore the first vmstat row when comparing recent samples because it commonly summarizes data since boot. Compare telemetry to the time of the application symptom.
Collect a short read-only baseline
date -u '+%FT%TZ'
uptime
free -h
vmstat -w 1 4
for resource in cpu memory io; do
path="/proc/pressure/$resource"
if test -r "$path"; then printf '%s\n' "$resource"; cat "$path"; fi
done
Possible output
2026-11-16T20:00:00Z
... load average: 0.12, 0.10, 0.08
...
cpu
some avg10=0.06 avg60=0.02 avg300=0.00 total=721540
memory
some avg10=0.00 avg60=0.00 avg300=0.00 total=2198
full avg10=0.00 avg60=0.00 avg300=0.00 total=661
io
some avg10=0.00 avg60=0.00 avg300=0.00 total=55385
The output is an abbreviated example. PSI percentages use rolling windows of roughly 10, 60, and 300 seconds. Missing files mean this interface is not available in that environment, not that pressure is zero.
Check who is consuming resources
ps -eo pid,comm,%cpu,%mem --sort=-%cpu | head -n 6
df -h "$HOME"
# If iostat is installed:
iostat -xz 1 3
Possible output
PID COMMAND %CPU %MEM
234 python3 9.8 1.6
...
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 30G 5.1G 23G 19% /
...
ps %CPU is normally averaged over a process lifetime rather than an instantaneous sample. df answers a capacity question, not an I/O latency question. If iostat is available, inspect interval data and compare it with the time and symptoms.
Questions only
Quick-check questions
- Why is free memory alone a poor measure of memory trouble?
- What does a sustained increase in I/O pressure tell you?
Assessment questions
- vmstat shows a sustained runnable queue and CPU PSI is elevated while memory and I/O pressure are low. Which resource comes first?
- How would you distinguish a full filesystem from slow disk requests?
- What would make you suspect the application rather than visible host resource pressure?
Questions and answers
Quick-check answers
- Why is free memory alone a poor measure of memory trouble?
Answer — Linux uses memory for cache that can often be reclaimed. Consider available memory, swap activity, pressure, and the workload. - What does a sustained increase in I/O pressure tell you?
Answer — At least some work is stalling for I/O. It does not identify which device or request caused the stall.
Assessment answer key
- vmstat shows a sustained runnable queue and CPU PSI is elevated while memory and I/O pressure are low. Which resource comes first?
Answer — Investigate CPU scheduling and top CPU consumers first, then correlate with application latency. - How would you distinguish a full filesystem from slow disk requests?
Answer — Use df for capacity and interval I/O telemetry plus PSI for activity, queue and waiting symptoms. - What would make you suspect the application rather than visible host resource pressure?
Answer — A reproducible slowdown with no corresponding resource pressure makes application logs, dependencies, and request timing worth examining.
Related source articles on this site
- Linux: Disk Space, Memory Space, Running Processes
- Monitor Process in Linux
- ইউনিক্সঃ সিস্টেম পারফর্মেন্স (Unix – System Performance)
- ইউনিক্সঃ সিস্টেম লগিং (Unix – System Logging)
Technical references
Continue the course
Previous lesson 03 — Repeatable Configuration with Ansible. Next lesson 05 — Kernel Modules and Resource Limits.
Linux course index · Linux Advanced 2 category · Lesson 4 of 7
