Disk / Memory / CPU Troubleshooting

This page gives the fastest commands for capacity and performance issues. The goal is to identify whether the bottleneck is storage, memory pressure, CPU saturation, or process limits.

Disk

df -h
du -sh /var/log/*
find /var/log -type f -size +100M
iostat -xz 1 3
lsof | grep deleted

Use cases: disk full, growing logs, deleted-but-still-open files, slow storage, container volume issues.

Memory

free -h
vmstat 1 5
top
ps aux --sort=-%mem | head
pmap -x PID | tail -20

Use cases: RAM pressure, swap activity, large Java process, leak suspicion, runaway cache.

CPU

top
htop
mpstat -P ALL 1 3
ps aux --sort=-%cpu | head
uptime

Use cases: high CPU, one hot core, thread contention, busy container, load spikes.

Fast Triage Sequence

  1. Check uptime and top.
  2. Check free disk with df -h.
  3. Check biggest directories with du -sh *.
  4. Check memory with free -h and vmstat.
  5. Check per-core CPU with mpstat -P ALL 1 3.
  6. Check application process ownership of ports and files.