USE method: Utilization, Saturation, Errors for every resource.
USE Method¶
- CPU: top -> utilization, vmstat -> runqueue
- Memory: free -h, vmstat si/so
- Disk: iostat -> utilization, await
- Network: sar -n DEV
CPU¶
top -o %CPU cpupower frequency-set -g performance taskset -c 0-3 ./my-app
Memory¶
free -h ps aux –sort=-%mem | head -10 sysctl vm.swappiness=10
Disk¶
iostat -xz 1 iotop -oP echo mq-deadline > /sys/block/sda/queue/scheduler
Sysctl¶
/etc/sysctl.d/99-perf.conf¶
vm.swappiness = 10 net.core.somaxconn = 65535 net.ipv4.tcp_tw_reuse = 1 fs.file-max = 2097152
Measure, Then Optimize¶
Never blindly. USE method -> identify the bottleneck -> targeted optimization.