zoukankan      html  css  js  c++  java
  • cpu负载

    查看cpu负载,我们经常会使用top,或者是uptime命令

    但是这只能看到cpu的总体的负载情况。如果我们想看cpu每个核心的负载情况是看不到的。

    所以我们可以用mpstat命令

    服务器一共32核心

    [root@kvm02 ~]# mpstat -P ALL
    Linux 3.10.0-229.el7.x86_64 (kvm02) 2017年05月29日 _x86_64_ (32 CPU)

    14时54分10秒 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
    14时54分10秒 all 0.02 0.00 0.03 0.01 0.00 0.00 0.00 0.02 0.00 99.92
    14时54分10秒 0 0.02 0.00 0.05 0.04 0.00 0.00 0.00 0.04 0.00 99.84
    14时54分10秒 1 0.03 0.00 0.01 0.00 0.00 0.00 0.00 0.00 0.00 99.95
    14时54分10秒 2 0.01 0.00 0.06 0.00 0.00 0.00 0.00 0.04 0.00 99.89
    14时54分10秒 3 0.03 0.00 0.01 0.00 0.00 0.00 0.00 0.01 0.00 99.95
    14时54分10秒 4 0.02 0.00 0.06 0.00 0.00 0.00 0.00 0.05 0.00 99.87
    14时54分10秒 5 0.03 0.00 0.02 0.00 0.00 0.00 0.00 0.01 0.00 99.93
    14时54分10秒 6 0.01 0.00 0.06 0.00 0.00 0.00 0.00 0.04 0.00 99.89
    14时54分10秒 7 0.03 0.00 0.02 0.00 0.00 0.00 0.00 0.01 0.00 99.93
    14时54分10秒 8 0.01 0.00 0.05 0.00 0.00 0.00 0.00 0.04 0.00 99.89
    14时54分10秒 9 0.03 0.00 0.02 0.00 0.00 0.00 0.00 0.01 0.00 99.94
    14时54分10秒 10 0.01 0.00 0.06 0.00 0.00 0.00 0.00 0.05 0.00 99.88
    14时54分10秒 11 0.03 0.00 0.01 0.00 0.00 0.00 0.00 0.01 0.00 99.95
    14时54分10秒 12 0.01 0.00 0.06 0.00 0.00 0.00 0.00 0.04 0.00 99.89
    14时54分10秒 13 0.03 0.00 0.01 0.00 0.00 0.00 0.00 0.00 0.00 99.95
    14时54分10秒 14 0.01 0.00 0.06 0.00 0.00 0.00 0.00 0.05 0.00 99.88
    14时54分10秒 15 0.03 0.00 0.01 0.00 0.00 0.00 0.00 0.01 0.00 99.95
    14时54分10秒 16 0.00 0.00 0.04 0.00 0.00 0.00 0.00 0.04 0.00 99.91
    14时54分10秒 17 0.01 0.00 0.01 0.00 0.00 0.00 0.00 0.00 0.00 99.98
    14时54分10秒 18 0.03 0.00 0.07 0.00 0.00 0.00 0.00 0.03 0.00 99.87
    14时54分10秒 19 0.02 0.00 0.04 0.01 0.00 0.00 0.00 0.00 0.00 99.92
    14时54分10秒 20 0.01 0.00 0.06 0.00 0.00 0.00 0.00 0.05 0.00 99.87
    14时54分10秒 21 0.01 0.00 0.02 0.00 0.00 0.00 0.00 0.00 0.00 99.96
    14时54分10秒 22 0.01 0.00 0.05 0.16 0.00 0.00 0.00 0.04 0.00 99.74
    14时54分10秒 23 0.01 0.00 0.02 0.00 0.00 0.00 0.00 0.00 0.00 99.97
    14时54分10秒 24 0.00 0.00 0.04 0.00 0.00 0.00 0.00 0.04 0.00 99.91
    14时54分10秒 25 0.01 0.00 0.01 0.00 0.00 0.00 0.00 0.00 0.00 99.99
    14时54分10秒 26 0.01 0.00 0.06 0.00 0.00 0.00 0.00 0.03 0.00 99.89
    14时54分10秒 27 0.01 0.00 0.01 0.00 0.00 0.00 0.00 0.00 0.00 99.98
    14时54分10秒 28 0.01 0.00 0.04 0.00 0.00 0.00 0.00 0.03 0.00 99.92
    14时54分10秒 29 0.01 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.99
    14时54分10秒 30 0.01 0.00 0.04 0.00 0.00 0.00 0.00 0.03 0.00 99.92
    14时54分10秒 31 0.01 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.98

    参数解释

    -P :表示监控哪个逻辑cpu

      ALL:表示监控所有cpu

      0-cpu核心总数 :表示查看指定逻辑cpu的负载

    例如:查看第20个逻辑cpu的负载情况

    [root@kvm02 ~]# mpstat -P 20

    Linux 3.10.0-229.el7.x86_64 (kvm02) 2017年05月29日 _x86_64_ (32 CPU)

    14时58分36秒 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
    14时58分36秒 20 0.01 0.00 0.06 0.00 0.00 0.00 0.00 0.05 0.00 99.87

  • 相关阅读:
    ( 转)移动端H5页面之iphone6的适配
    谨慎设置iScroll4的useTransform属性,他会导致scrollToElement方法表现异常
    (转)配置Apache服务器,使浏览器访问无缓存
    html DIV元素左右偏移方法,偏移后默认宽度仍浏览器宽度一致
    Content Security Policy(CSP)简介(转)
    隐式打开Activity——Intent设置(如何打开)和Intent-fileter配置(怎么能被打开)
    最近使用iScroll遇到的一些问题及最后的解决方法
    (转)CSS3 Media Queries
    自定义checkbox和radio
    三只松鼠卖坚果
  • 原文地址:https://www.cnblogs.com/pangbing/p/6918076.html
Copyright © 2011-2022 走看看