Linux Performance Tools


  • Methodologies: inefficient to just muddle around
    • Problem statement: 500
    • Workload characterization: 500
    • USE method: 500
    • Off-CPU analysis: 500
      • Record when a process steps off the CPU
    • CPU profile: 500
    • RTFM: 500
  • Linux load averages incorporate disk/etc. load, not just CPU
  • htop samples, so spikes that start and end within the refresh interval are missed entirely (atop solves this)
  • iostat to gauge the workload and resulting perf: 400
  • PMC: performance monitoring counters (hardware)
  • ip route get
  • Observability tools
    • Intermediate tools
      • strace (-ttt, -T)
      • tcpdump
        • Doesn’t scale well when you’re pushing a lot through a high-speed interface
      • netstat (-i, -r, -p, -c, -s)
      • nicstat
      • pidstat (-t)
      • swapon -s
      • lsof
      • sar (TCP, ETCP, DEV, EDEV)
    • Advanced tools
      • ss (-mop)
      • iptraf (histogram of packet sizes)
      • iotop
      • slabtop
      • pcstat (page cache usage by file)
      • perf_events (perf, perf top, perf stat - part of the kernel)
      • rdmsr (MSRs - model specific registers - enabled in Xen unlike PMCs)
      • ltrace
      • ethtool
      • snmpget
      • blktrace
      • pmu-tools
  • Benchmarking tools
    • perf bench
    • lmbench
    • fio
    • pchar
    • iperf, hping3
    • ttcp
  • Profiling tools
    • perf record (don’t pick 100Hz to avoid sampling in lockstep)
    • execsnoop
    • 500
  • Tracing tools
Edit