zoukankan      html  css  js  c++  java
  • Linux mpstat字段解析

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

    mpstat  
    219:45:12 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
    19:45:14 all 0.04 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.96
    19:45:16 all 0.00 0.00 0.00 0.03 0.00 0.00 0.00 0.00 99.97
    19:45:18 all 0.00 0.07 0.07 0.00 0.00 0.00 0.00 0.00 99.87
    

    字段的含义如下:

    %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

    具体的计算方式:
    total_cur=user+system+nice+idle+iowait+irq+softirq
    total_pre=pre_user+ pre_system+ pre_nice+ pre_idle+ pre_iowait+ pre_irq+ pre_softirq
    user=user_cur – user_pre
    total=total_cur-total_pre
    其中_cur 表示当前值,_pre表示interval时间前的值。上表中的所有值可取到两位小数点。   
  • 相关阅读:
    数据查询语言DQL 与 内置函数(聚合函数)
    数据操作语言DML与运算符
    解决Nginx重启时提示nginx: [emerg] bind() to 0.0.0.0:80错误
    Linux 重启nginx
    一群猴子排成一圈,按1,2,...,n依次编号
    阿里云云盾服务证书免费CA证书申请与配置 (原)
    Linux 配置文件
    php $_FILES上传失败 error返回值说明
    Ecshop 表结构 字段说明
    JS 笔记~
  • 原文地址:https://www.cnblogs.com/likui360/p/5845140.html
Copyright © 2011-2022 走看看