Linux mpstat命令详解

Linux mpstat命令详解

本文讲解基于centos8进行,mpstat用法和其他linux系统基本一致,只是安装命令不同。
mpstat是MultiProcessor Statistics的缩写,是实时系统监控工具。其报告与CPU的一些统计信息,这些信息存放在/proc/stat文件中。在多CPUs系统里,其不但能查看所有CPU的平均状况信息,而且能够查看特定CPU的信息。

mpstat命令安装

安装命令:

sudo yum install sysstat

mpstat 常用参数

在这里插入图片描述
常用命令:

查看当前主机所有cpu 负载情况
mpstat -P ALL

在这里插入图片描述
查看当前主机某一个cpu 负载

mpstat -P 0

每隔5秒内输出cpu负载信息,并采样10次

mpstat -P ALL 5 10

在这里插入图片描述

输出参数解释

在这里插入图片描述

输出参数备注
cpu表示cpu序号
%userShow the percentage of CPU utilization that occurred while executing at the user level (application) 执行用户层(应用)发生的CPU使用率百分比
%niceShow the percentage of CPU utilization that occurred while executing at the user level with nice priority. 执行用户层(带有nice优先级应用)发生的CPU使用率百分比
%sysShow 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执行内核层(不包含硬件中断和软中断)发生的cpu使用率百分比
%iowaithow the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request CPU在等待磁盘I/O请求时的空闲时间百分比
%irqShow the percentage of time spent by the CPU or CPUs to service hardware interrupts.硬件中断的CPU利用率百分比
%softShow the percentage of time spent by the CPU or CPUs to service software interrupts 软中断的cpu利用率百分比
%stealShow the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor CPU花在非自愿等待宿主机为其他虚拟CPU提供服务的时间百分比
%guestShow the percentage of time spent by the CPU or CPUs to run a virtual processor 运行虚拟CPU的时间百分比
%gShow the percentage of time spent by the CPU or CPUs to run a niced guest 运行带有nice优先级的虚拟CPU
%idleShow the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.CPU空间时间占比

不包含虚拟化的情况下:总cpu时间片 = user + nice + system + iowait + irq + softirq + idle

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值