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

  • 相关阅读:
    机器码信息
    Q: ossfs挂载时如何设置权限?
    js获取url信息
    快递在线下单
    nginx反向代理与负载均衡配置
    mono-apache配置
    Migrating an Existing Website from SQL Membership to ASP.NET Identity
    C# GUID转换成16位字符串或19位数字并确保唯一
    图片服务器
    王宝强离婚宋喆遭扒 黑客告诉你哪些个人信息需要保护
  • 原文地址:https://www.cnblogs.com/pangbing/p/6918076.html
Copyright © 2011-2022 走看看