In a system with multiple processors how can I display the utilization of each CPU individually ?

本文介绍如何使用mpstat和sar命令在Red Hat Enterprise Linux系统中查看每个CPU的利用率,包括单个处理器和所有处理器的统计数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://access.redhat.com/solutions/1178

In a system with multiple processors how can I display the utilization of each CPU individually ?

 SOLUTION 已验证 - 已更新 2013年九月12日06:39 - 

English 

环境

  • Red Hat Enterprise Linux 3
  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • mpstat
  • sar

问题

  • In a system with multiple processors how can I display the utilization of each CPU individually ?

决议

  • Use "mpstat" or "sar" commands to reports processors related statistics.

  • CPU statistics of a single processor.

Raw

# mpstat -P <processor_number>

Eg:

Raw

# mpstat -P 0
Linux 2.6.32-358.14.1.el6.x86_64 (server1)  09/12/2013  _x86_64_    (4 CPU)

03:27:55 AM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
03:27:55 AM    0    9.30    0.17    3.14    1.57    0.00    0.01    0.00    0.00   85.80
  • CPU statistics of all processors.

Raw

# mpstat -P ALL
# sar -P ALL 

Eg:

Raw

# mpstat -P ALL
Linux 2.6.32-358.14.1.el6.x86_64 (server1)  09/12/2013  _x86_64_    (4 CPU)

03:20:44 AM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
03:20:44 AM  all    4.73    0.12    1.78    0.62    0.00    0.01    0.00    0.00   92.74
03:20:44 AM    0    9.11    0.18    3.13    1.58    0.00    0.01    0.00    0.00   86.00
03:20:44 AM    1    6.77    0.29    2.73    0.59    0.00    0.03    0.00    0.00   89.59
03:20:44 AM    2    1.68    0.00    0.81    0.13    0.00    0.00    0.00    0.00   97.38
03:20:44 AM    3    1.40    0.00    0.47    0.18    0.00    0.00    0.00    0.00   97.93

# sar -P ALL 
Linux 2.6.32-358.14.1.el6.x86_64 (server1)  09/12/2013  _x86_64_    (4 CPU)

12:00:01 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
12:10:01 AM     all      8.71      0.00      2.77      0.89      0.00     87.62
12:10:01 AM       0     19.61      0.00      4.79      1.89      0.00     73.72
12:10:01 AM       1     13.04      0.00      5.29      1.20      0.00     80.46
12:10:01 AM       2      1.22      0.00      0.72      0.21      0.00     97.84
12:10:01 AM       3      1.10      0.00      0.31      0.29      0.00     98.30
12:20:01 AM     all      1.50      0.45      1.28      0.27      0.00     96.51
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值