首页  

linux mpstat 命令     所属分类 linux 浏览量 920
mpstat 
Multiprocessor Statistics
/proc/stat
可以查看每个cpu的统计数据

mpstat [ -A ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] [ -P { cpu [,...] | ON | ALL } ] [ interval [ count ] ]


mpstat 2 5
Linux 3.10.0-693.el7.x86_64 (dyyx) 	2020年11月17日 	_x86_64_	(32 CPU)

08时53分08秒  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
08时53分10秒  all    0.63    0.00    0.25    0.00    0.00    0.02    0.00    0.00    0.00   99.11
08时53分12秒  all    0.61    0.00    0.25    0.00    0.00    0.05    0.00    0.00    0.00   99.09
08时53分14秒  all    0.61    0.00    0.24    0.00    0.00    0.03    0.00    0.00    0.00   99.12
08时53分16秒  all    0.56    0.00    0.24    0.00    0.00    0.03    0.00    0.00    0.00   99.17
08时53分18秒  all    0.53    0.00    0.24    0.00    0.00    0.03    0.00    0.00    0.00   99.20
平均时间:  all    0.59    0.00    0.24    0.00    0.00    0.03    0.00    0.00    0.00   99.14

32核


%usr      Show the percentage of CPU utilization that occurred while executing at the user level (application).
%nice     Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.
%sys      Show the percentage of CPU utilization that occurred while executing at the system level (kernel). Note that this does not include time spent servicing hardware and software interrupts.
%iowait   Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
%irq      Show the percentage of time spent by the CPU or CPUs to service hardware interrupts.
%soft     Show the percentage of time spent by the CPU or CPUs to service software interrupts.
%steal    Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.
%guest    Show the percentage of time spent by the CPU or CPUs to run a virtual processor.
%gnice    Show the percentage of time spent by the CPU or CPUs to run a niced guest.
%idle     Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
                     
                     
outstanding disk I/O request
未完成的磁盘请求



mpstat -P ALL 
查看每个核的统计数据

09时12分09秒  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
09时12分09秒  all    0.61    0.00    0.26    0.02    0.00    0.01    0.00    0.00    0.00   99.11
09时12分09秒    0    0.75    0.00    0.29    0.02    0.00    0.04    0.00    0.00    0.00   98.91
09时12分09秒    1    0.67    0.00    0.24    0.02    0.00    0.01    0.00    0.00    0.00   99.07
09时12分09秒    2    0.73    0.00    0.28    0.02    0.00    0.01    0.00    0.00    0.00   98.95
09时12分09秒    3    0.63    0.00    0.23    0.02    0.00    0.00    0.00    0.00    0.00   99.12

mpstat -P 0
查看cpu0的统计数据

上一篇     下一篇
Java方法调用的字节码指令

k8s面试题

top命令输出说明

linux iostat 命令

linux sysstat

jvm到底能运行多少个线程