When a server is slow or a service is down, a fixed routine beats guessing. These are the twelve commands I run first, in order, and what to look for.
1. Is the machine overloaded?
uptime
The three load averages (1, 5, 15 minutes) should be below your CPU count. Compare with nproc.
2. Who is using CPU and memory?
top -o %CPU # or: htop
ps aux --sort=-%mem | head
Look for one process dominating, or many copies of the same process.
3. Is memory exhausted?
free -h
dmesg -T | grep -i -E 'out of memory|oom' | tail
If available is near zero or the kernel killed processes, you have a memory problem, not a CPU one.
4. Is the disk full?
df -h
df -i # inodes can run out even when space is free
du -xh /var --max-depth=1 | sort -h | tail
A full /var (logs) is the most common cause of mysterious failures.
5. Is the disk slow?
iostat -x 1 3 # from the sysstat package
High %util and await mean the disk is the bottleneck.
6. What failed recently?
systemctl --failed
journalctl -p err -b --no-pager | tail -50
7. Is the service itself healthy?
systemctl status myapp
journalctl -u myapp -n 100 --no-pager
8. Is anything listening where it should?
ss -tulpn # listening sockets and the owning process
9. Can the network reach the world?
ping -c 3 1.1.1.1
curl -sI https://example.com | head -5
dig +short example.com
If IP works but names do not, it is DNS.
10. How many connections are open?
ss -s
ss -tan state established | wc -l
A sudden spike can mean traffic, a leak or an attack.
11. Did a recent change cause it?
last -n 10 # recent logins
find /etc -mmin -60 -type f 2>/dev/null # config changed in the last hour
12. Is the clock right?
timedatectl
Wrong time breaks TLS, tokens and log correlation.
Habit worth building
Write down the output of each step as you go. Most incidents are solved by step 4 or 6, and the notes make the post-mortem easy.
For quick offline helpers while debugging (JSON, Base64, URL encoding), I keep a browser-only toolbox here: https://luxury-malabi-8a7447.netlify.app/toolbox.html
Written by Yogeshwaran Tech Tools. Corrections welcome.
Top comments (0)