1

Linux环境监控工具汇总

 1 year ago
source link: https://os.51cto.com/article/710393.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

f195aef40350f509e7e73971eb826c6bd9cc00.jpg
  • top(经典的Linux任务管理工具)
示例:top -n 1 -b
  • vmstat(展现给定时间间隔的服务器的状态值,包括服务器的CPU使用率,内存使用)
示例:vmstat 1 10    #每1秒采集一次共采集10次
  • pidstat(进程实时监控)
示例:pidstat -u 1 -p pid
  • mpstat(多CPU实时监控工具)
示例:mpstat -P ALL 1 5
  • sar (性能监控和瓶颈检查)
示例:sar -u
  • dstat(dstat 是一个可以取代vmstat,iostat,netstat和ifstat这些命令的多功能产品)
示例:dstat 2 10(每2秒采集一次共采集10次)
示例:top -n 1 -b
  • pidstat
示例:pidstat -r
  • free(查看当前系统的物理内存使用情况)
示例:free -mh
  • sar (性能监控和瓶颈检查)
示例:sar -r 10 3(每10秒采样一次,连续采样3次)
  • vmstat
示例:vmstat 2 1
  • iostat (IO实时监控)
示例:iostat -d -x -k 1 10
  • iotop(监控系统中各个进程对IO的使用量)
示例:iotop
  • pidstat
示例: pidstat -d
示例:sar -d
  • vmstat
示例:vmstat 2 1
  • netstat(监控TCP/IP网络)
示例:netstat -nltup
  • iftop(实时流量监控工具)
示例:iftop -i em2
  • ss(获取socket统计信息,它可以显示和netstat类似的内容)
示例:ss -aA tcp
示例:sar -n EDEV 1 5
  • tcpdump(抓包工具)
示例:tcpdump -i em1 host 192.168.1.1 and port 80
  • tcpflow(分析网络流量)
示例:tcpflow -i em1 port 80
  • nload(用于查看linux网络流量状况,实时输出)
示例:nload -t 200 -i 1024 -o 128 -U M
  • CPU负载说明

 假如某个程序频繁的进行计算、逻辑判断等操作,那么此类程序主要依赖于CPU的处理速度,故称之为"计算密集型程序"。

  • IO负载说明

假如某个程序频繁的从磁盘中读取写入文件,那么这种类型的操作主要依赖于磁盘的读取速度,也就是输入输出(input/output)简写为I/O。此类I/O负载的程序,称为I/O密集型程序。

示例:top
  • uptime
示例:uptime
示例:sar -q 1 20
  • htop(类似top,比top更加人性化)
  • glances(类似top,基于 Python 的系统遥测监控工具)
  • strace(常用来跟踪进程执行时的系统调用和所接收的信号)
  • dtrace(动态跟踪)
  • valgrind(内存泄漏检测)
  • dmesg(内核信息)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK