Linux Performance Checklists for SREs
Linux Perf Analysis in 60s (
https://netflixtechblog.com/linux-performance-analysis-in-60-000-milliseconds-accc10403c55)
1.
uptime ⟶ load averages
2.
dmesg -T | tail ⟶ kernel errors
3.
vmstat 1 ⟶ overall stats by time
4.
mpstat -P ALL 1 ⟶ CPU balance
5.
pidstat 1 ⟶ process usage
6.
iostat -xz 1 ⟶ disk I/O
7.
free -m ⟶ memory usage
8.
sar -n DEV 1 ⟶ network I/O
9.
sar -n TCP,ETCP 1 ⟶ TCP stats
10.
top ⟶ check overview
Linux Disk Checklist
1.
iostat -xz 1 ⟶ any disk I/O? if not, stop looking
2.
vmstat 1 ⟶ is this swapping? or, high sys time?
3.
df -h ⟶ are file systems nearly full?
4.
ext4slower 10 ⟶ (zfs*, xfs*, etc.) slow file system I/O?
5.
bioslower 10 ⟶ if so, check disks
6.
ext4dist 1 ⟶ check distribution and rate
7.
biolatency 1 ⟶ if interesting, check disks
8.
cat /sys/devices/…/ioerr_cnt ⟶ (if available) errors
9.
smartctl -l error /dev/sda1 ⟶ (if available) errors
* Another short checklist. Won't solve everything. ext4slower/dist, bioslower/latency, are from bcc/BPF tools.
Linux Network Checklist
1.
sar -n DEV,EDEV 1 ⟶ at interface limits? or use nicstat
2.
sar -n TCP,ETCP 1 ⟶ active/passive load, retransmit rate
3.
cat /etc/resolv.conf ⟶ it's always DNS
4.
mpstat -P ALL 1 ⟶ high kernel time? single hot CPU?
5.
tcpretrans ⟶ what are the retransmits? state?
6.
tcpconnect ⟶ connecting to anything unexpected?
7.
tcpaccept ⟶ unexpected workload?
8.
netstat -rnv ⟶ any inefficient routes?
9.
check firewall config ⟶ anything blocking/throttling?
10.
netstat -s ⟶ play 252 metric pickup
* tcp*, are from bcc/BPF tools.
Linux CPU Checklist
1.
uptime ⟶ load averages
2.
vmstat 1 ⟶ system-wide utilization, run q length
3.
mpstat -P ALL 1 ⟶ CPU balance
4.
pidstat 1 ⟶ per-process CPU
5.
CPU flame graph ⟶ CPU profiling
6.
CPU subsecond offset heat map ⟶ look for gaps
7.
perf stat -a -- sleep 10 ⟶ IPC, LLC hit ratio
* htop can do 1-4. I'm tempted to add execsnoop for short-lived processes (it's in perf-tools or bcc/BPF tools).
https://www.brendangregg.com/blog/2016-05-04/srecon2016-perf-checklists-for-sres.html