mpstat--CPU处理器统计信息

mpstat - 处理器统计信息

1.不带任何参数的使用mpstat命令将会输出所有CPU的平均统计信息

 
  1. tecmint@tecmint ~ $ mpstat
  2.  
  3. Linux 3.11.0-23-generic (tecmint.com) Thursday 04 September 2014 _i686_ (2 CPU)
  4.  
  5. 12:23:57 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
  6. 12:23:57 IST all 37.35 0.01 4.72 2.96 0.00 0.07 0.00 0.00 0.00 54.88

2.使用‘-p’ (处理器编号)和‘ALL’参数将会从0开始独立的输出每个CPU的统计信息,0表示第一个cpu。

 
  1. tecmint@tecmint ~ $ mpstat -P ALL
  2.  
  3. Linux 3.11.0-23-generic (tecmint.com) Thursday 04 September 2014 _i686_ (2 CPU)
  4.  
  5. 12:29:26 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
  6. 12:29:26 IST all 37.33 0.01 4.57 2.58 0.00 0.07 0.00 0.00 0.00 55.44
  7. 12:29:26 IST 0 37.90 0.01 4.96 2.62 0.00 0.03 0.00 0.00 0.00 54.48
  8. 12:29:26 IST 1 36.75 0.01 4.19 2.54 0.00 0.11 0.00 0.00 0.00 56.40

3.要进行‘N’次,平均每次间隔n秒的输出CPU统计信息,如下所示。

 
  1. tecmint@tecmint ~ $ mpstat -P ALL 2 5
  2.  
  3. Linux 3.11.0-23-generic (tecmint.com) Thursday 04 September 2014 _i686_ (2 CPU)
  4.  
  5. 12:36:21 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
  6. 12:36:23 IST all 53.38 0.00 2.26 0.00 0.00 0.00 0.00 0.00 0.00 44.36
  7. 12:36:23 IST 0 46.23 0.00 1.51 0.00 0.00 0.00 0.00 0.00 0.00 52.26
  8. 12:36:23 IST 1 60.80 0.00 3.02 0.00 0.00 0.00 0.00 0.00 0.00 36.18
  9.  
  10. 12:36:23 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
  11. 12:36:25 IST all 34.18 0.00 2.30 0.00 0.00 0.00 0.00 0.00 0.00 63.52
  12. 12:36:25 IST 0 31.63 0.00 1.53 0.00 0.00 0.00 0.00 0.00 0.00 66.84
  13. 12:36:25 IST 1 36.73 0.00 2.55 0.00 0.00 0.00 0.00 0.00 0.00 60.71
  14.  
  15. 12:36:25 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
  16. 12:36:27 IST all 33.42 0.00 5.06 0.25 0.00 0.25 0.00 0.00 0.00 61.01
  17. 12:36:27 IST 0 34.34 0.00 4.04 0.00 0.00 0.00 0.00 0.00 0.00 61.62
  18. 12:36:27 IST 1 32.82 0.00 6.15 0.51 0.00 0.00 0.00 0.00 0.00 60.51

(LCTT译注: 上面命令中‘2’ 表示每2秒执行一次‘mpstat -P ALL’命令, ‘5’表示共执行5次)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值