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

  • 相关阅读:
    Matlab命令集常用字符串函数
    统计独立性和统计相关性
    查看solaris下硬盘的物理大小
    Perl命令行开关
    DateFormat.getDateInstance出现Unparseable date
    ActiveMQ 本地转本地再转远程的完整配置
    aspose.words 操作word生成试卷
    汇编in和out介绍
    eclipse开发国际化项目利器:MultiProperties
    RCP+GEF+界面开发(2)[eclipse插件配置LINK方法]
  • 原文地址:https://www.cnblogs.com/pangbing/p/6918076.html
Copyright © 2011-2022 走看看