性能观察工具 - 图1

OS : top, mpstat, sar/sysstat, htop, atop, pidstat
Memory : free, vmstat, slabtop
Disk : iostat, iotop, ioping
Network : nc, netstat, nmap, tcpdump, ss, vnstat, nethogs, iptraf, iftop, traceroute, mtr
Web : curl, httpstat, openssl (for cert verification)

  1. uptime
  2. dmesg | tail
  3. vmstat 1
  4. mpstat -P ALL 1
  5. pidstat 1
  6. iostat -xz 1
  7. free -m
  8. sar -n DEV 1
  9. sar -n TCP,ETCP 1
  10. top

https://netflixtechblog.com/linux-performance-analysis-in-60-000-milliseconds-accc10403c55

MTR 文档

https://www.linode.com/docs/guides/diagnosing-network-issues-with-mtr/

TCPDUMP

https://danielmiessler.com/study/tcpdump/
https://www.wireshark.org/docs/wsug_html_chunked/AppToolstcpdump.html

HTTP 连接时间

while true; do date; curl -so /dev/null -w”\nTiming:\n-~-~-~-~-~-~-~-~-~-~-\nDNS Resolution Time=%{time_namelookup}\nTCP Handshake=%{time_connect}\nSSL Handshake=%{time_appconnect}\ntime_pre_transfer=%{time_pretransfer}\ntime_redirect=%{time_redirect}\ntime_starttransfer=%{time_starttransfer}\nnum_connects=%{num_connects}\n-~- Total Time Spent=%{time_total}\nHTTP Details:\nHTTP Status Code:%{http_code}\nRequest Size:%{size_request}\n==========================================\n” google.com; sleep 1; done