Linux Response-Slowness Command Reference
Goal: quickly identify whether response delay originates in DNS, network/TLS, the application, CPU, memory, storage, resource limits, or the kernel.
Related: Linux and Talos Operations · System setup · Investigation guide
Replace placeholders before running. Some commands require
sudo. Optional tools may come fromsysstat,dnsutils/bind-utils,iproute2,lsof,strace,netcat, andnet-toolspackages.
1. Time and host load
2. Request timing
curl -sS -o /dev/null -w 'DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTLS: %{time_appconnect}s\nFirst byte: %{time_starttransfer}s\nTotal: %{time_total}s\nHTTP: %{http_code}\n' '<URL>'
3. System overview
4. CPU
Known process threads
5. Memory and swap
free -h
vmstat 1
cat /proc/meminfo
ps -eo pid,comm,%mem,rss,vsz --sort=-rss | head -20
swapon --show
OOM events
sudo journalctl -k --since '1 hour ago' | grep -iE 'oom|out of memory|killed process'
sudo dmesg -T | grep -iE 'oom|out of memory|killed process'
6. Storage and filesystems
Open and deleted files
7. Network
TCP errors, drops, and retransmissions
netstat -s | grep -iE 'retrans|listen|drop|overflow'
nstat -az | grep -iE 'Retrans|Timeout|Listen|Drop'
Dependency connectivity
8. DNS
time getent hosts <HOST>
dig <HOST> +stats
resolvectl status
curl -v --resolve '<HOST>:443:<IP>' 'https://<HOST>/'
9. Blocked processes
ps -eo state,pid,ppid,wchan:30,comm,args | awk '$1 ~ /^D/'
ps -eo pid,stat,wchan:32,comm,args --sort=stat
Trace a known process briefly
10. File descriptors and limits
ulimit -a
cat /proc/<PID>/limits
find /proc/<PID>/fd -maxdepth 1 -type l 2>/dev/null | wc -l
cat /proc/sys/fs/file-nr
Limit-related errors
sudo journalctl --since '30 minutes ago' | grep -iE 'too many open files|resource temporarily unavailable'
11. Service health and logs
systemctl status <SERVICE> --no-pager
sudo journalctl -u <SERVICE> --since '30 minutes ago' --no-pager
sudo journalctl -p warning --since '30 minutes ago' --no-pager
sudo journalctl -f -u <SERVICE>
systemctl show <SERVICE> -p ActiveEnterTimestamp -p ExecMainStartTimestamp -p NRestarts
12. Kernel and hardware events
sudo dmesg -T | tail -100
sudo journalctl -k --since '1 hour ago' --no-pager
sudo journalctl -k --since '1 hour ago' --no-pager | grep -iE 'error|timeout|reset|blocked|hung|I/O|segfault|thermal'