详解mpstat等性能监测命令的使用

mpstat是Multiprocessor Statistics的缩写,是实时监控工具,报告与cpu的一些统计信息这些信息都存在/proc/stat文件中,在多CPU系统里,其不但能查看所有的CPU的平均状况的信息,而且能够有查看特定的cpu信息,mpstat最大的特点是:可以查看多核心的cpu中每个计算核心的统计数据;而且类似工具vmstat只能查看系统的整体cpu情况。

实例:查看多核cpu当前运行的状况,每两秒更新一次,一共更新5次

# mpstat 2 5
Linux 3.10.0-327.el7.x86_64 (yankerp) 11/01/2017 _x86_64_ (1 CPU)

07:13:28 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
07:13:30 PM all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
07:13:32 PM all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
07:13:34 PM all 0.50 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 99.00
07:13:36 PM all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
07:13:38 PM all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
Average: all 0.10 0.00 0.10 0.00 0.00 0.00 0.00 0.00 0.00 99.80
 

 

字段的含义

%user      在internal时间段里,用户态的CPU时间(%),不包含nice值为负进程  (usr/total)*100
%nice      在internal时间段里,nice值为负进程的CPU时间(%)   (nice/total)*100
%sys       在internal时间段里,内核时间(%)       (system/total)*100
%iowait    在internal时间段里,硬盘IO等待时间(%) (iowait/total)*100
%irq         在internal时间段里,硬中断时间(%)     (irq/total)*100
%soft       在internal时间段里,软中断时间(%)     (softirq/total)*100
%idle       在internal时间段里,CPU除去等待磁盘IO操作外的因为任何原因而空闲的时间闲置时间(%) (idle/total)*100

转载自https://blog.csdn.net/qq_39591494/article/details/78418162

另附一篇性能检测与优化命令https://www.mayou18.com/linux/txe0h34Ud.html

猜你喜欢

转载自www.cnblogs.com/wangshaowei/p/11366984.html