troubleshooting commands
32 commands, each with a one-line explanation. Click a command to copy it, or its title for details.
Commands 32 shown
-
pidstat -t -p <pid> 1Per-thread CPU%, find the hot TID inside a busy process for jstack/perf
-
top -H -p <pid>Live per-thread view; convert hot TID to hex (printf %x) to match jstack nid
-
mpstat -P ALL 1Per-core %usr/%sys/%iowait — spot a single saturated core vs balanced load
-
vmstat 1 5 | awk 'NR>2{print "runq="$1" blocked="$2}'; nprocvmstat r column (runnable) above nproc means CPU saturation, not just high load
-
ps -o nlwp= -p <pid>; ps -eLf | wc -lThread count per pid and system-wide; runaway threads exhaust kernel.pid_max
-
while sleep 5; do ps -o rss= -p <pid> | awk '{print strftime("%T"),$1/1024"MB"}'; doneSample RSS every 5s to confirm a real leak (monotonic growth) vs steady churn
-
cat /proc/<pid>/smaps_rollupOne-shot Rss/Pss/Swap totals without parsing full smaps; cheap on huge maps
-
pmap -x <pid> | sort -k3 -rn | headTop RSS mappings by region; spot a leaking heap, mmap or shared lib bloat
-
slabtop -o -s c | head -20Sort slab caches by size; dentry/inode bloat explains kernel memory pressure
-
grep -E 'Slab|SReclaimable|SUnreclaim' /proc/meminfoSplit slab into reclaimable vs unreclaimable; high SUnreclaim = real kernel leak
-
dmesg -T | grep -iE 'killed process|out of memory' | tailFind OOM victims with human timestamps; -T avoids unreadable kernel ticks
-
cat /proc/<pid>/oom_score /proc/<pid>/oom_score_adjHigher oom_score = likelier victim; set oom_score_adj -1000 to immunize a pid
-
cat /sys/fs/cgroup/<name>/memory.events | grep -E 'oom|max'oom_kill/max counters per cgroup; pod hitting memory.max before node-wide OOM
-
lsof +L1 | sort -k7 -rn | headdf full but du clean? Unlinked files held open by a pid; restart it to reclaim
-
iostat -x 1 | awk '$1!~/^$/{print $1, "util="$NF, "await="$(NF-2)}'%util near 100 with rising await = saturated device; correlate with the noisy pid
-
biotop-bpfcc -C 5 1bcc biotop: which pid drives block I/O by bytes/latency; modern: bpftrace one-liners
-
conntrack -L 2>/dev/null | wc -l; conntrack -SCount tracked flows vs limit; -S shows insert_failed/drop when table full
-
conntrack -E -p tcp --dport 443 -o timestampStream NEW/DESTROY events live to catch NAT/timeout drops on a port
-
ss -tan state time-wait | wc -l; sysctl net.ipv4.ip_local_port_rangeCount TIME-WAIT sockets vs port range; note: tune tw_reuse not tw_recycle
-
ss -s; ss -tan state syn-sent | wc -lOne-shot socket totals by state; SYN-SENT pileup hints at SYN drops/firewall
-
tracepath -n <host>; ping -M do -s 1472 -c2 <host>Find PMTU drop hop; ping -M do forbids frag to pinpoint blackhole MTU
-
ip route get <ip>; ip neigh show | grep -E 'FAILED|INCOMPLETE'Show actual src/iface for a dest; FAILED neigh entries = L2/ARP problem
-
traceroute -T -p 443 <host>; nc -zv <host> 443TCP-SYN traceroute survives ICMP filtering; nc -zv confirms open port
-
curl -sv --resolve <host>:443:<ip> https://<host>/healthzPin host to a specific IP to test backend while keeping SNI/Host header
-
kubectl run dnsutils --image=tutum/dnsutils -it --rm --restart=Never -- nslookup kubernetes.defaultThrowaway pod to resolve in-cluster names; verifies CoreDNS + kube-dns svc
-
dig +short @$(kubectl -n kube-system get svc kube-dns -o jsonpath='{.spec.clusterIP}') <name>.<ns>.svc.cluster.localHit CoreDNS clusterIP straight; note: ndots:5 makes short names spam queries
-
kubectl -n kube-system get cm coredns -o yaml; kubectl -n kube-system logs deploy/coredns --tail=50Review Corefile (forward/cache) and tail logs for SERVFAIL/upstream errors
-
nmap --script ssl-enum-ciphers -p 443 <host>Grade supported TLS versions/ciphers; flags weak/deprecated suites per port
-
openssl s_client -connect <host>:443 -servername <host> -showcerts 2>/dev/null | grep -E 'Verify|s:|i:'Show full chain with correct SNI; Verify line catches missing intermediates
-
for h in $(cat hosts.txt); do echo -n "$h "; echo | openssl s_client -connect $h:443 -servername $h 2>/dev/null | openssl x509 -noout -enddate; doneLoop many hosts to print notAfter dates; pipe to sort for soonest expiry
-
cut -d. -f2 <<<"$JWT" | tr '_-' '/+' | base64 -d 2>/dev/null | jq .Decode payload to inspect exp/iss/aud; note: fixes base64url, skips sig check
-
grpcurl -plaintext <host>:<port> list; grpcurl -plaintext <host>:<port> describe <svc>Enumerate services/methods over reflection; -plaintext skips TLS for debug
no commands match — try a different search