当前位置:   article > 正文

使用sar -u查看cpu使用率情况

sar -u
  1. [root@abc ~]# man sar
  2. -u [ ALL ]
  3. Report CPU utilization. The ALL keyword indicates that all the CPU fields should be displayed. The report may show the following fields:
  4. %user
  5. Percentage of CPU utilization that occurred while executing at the user level (application). Note that this field includes time spent running virtual processors.
  6. %usr
  7. Percentage of CPU utilization that occurred while executing at the user level (application). Note that this field does NOT include time spent running virtual proces-
  8. sors.
  9. %nice
  10. Percentage of CPU utilization that occurred while executing at the user level with nice priority.
  11. %system
  12. Percentage of CPU utilization that occurred while executing at the system level (kernel). Note that this field includes time spent servicing hardware and software interrupts.
  13. %sys
  14. Percentage of CPU utilization that occurred while executing at the system level (kernel). Note that this field does NOT include time spent servicing hardware or soft-ware interrupts.
  15. %iowait
  16. Percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
  17. %steal
  18. Percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.
  19. %irq
  20. Percentage of time spent by the CPU or CPUs to service hardware interrupts.
  21. %soft
  22. Percentage of time spent by the CPU or CPUs to service software interrupts.
  23. %guest
  24. Percentage of time spent by the CPU or CPUs to run a virtual processor.
  25. %idle
  26. Percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
  27. Note: On SMP machines a processor that does not have any activity at all (0.00 for every field) is a disabled (offline) processor.

  1. [root@abc ~]# sar -u ALL 1 10
  2. Linux 2.6.32-642.el6.x86_64 (abc) 06/06/2018 _x86_64_ (4 CPU)
  3. 01:56:08 PM CPU %usr %nice %sys %iowait %steal %irq %soft %guest %idle
  4. 01:56:09 PM all 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 99.75
  5. 01:56:10 PM all 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.00 99.50
  6. 01:56:11 PM all 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 99.75
  7. 01:56:12 PM all 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 99.75
  8. 01:56:13 PM all 0.25 0.00 0.50 0.00 0.00 0.00 0.00 0.00 99.25
  9. 01:56:14 PM all 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 99.75
  10. 01:56:15 PM all 0.00 0.00 0.25 0.25 0.00 0.00 0.00 0.00 99.50
  11. 01:56:16 PM all 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 99.75
  12. 01:56:17 PM all 0.00 0.00 0.50 0.00 0.00 0.00 0.00 0.00 99.50
  13. 01:56:18 PM all 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 99.75
  14. Average: all 0.05 0.00 0.30 0.03 0.00 0.00 0.00 0.00 99.62
  15. [root@abc ~]#
  1. Spending time in %user is expected behavior, as this is where all non-system tasks are accounted for.
  2. If cycles are actively being spent in %system then much of the execution time is being spent in lower-level code.
  3. If %iowait is high then it indicates processes are actively waiting due to disk accesses being a bottleneck on the system.

注意上面的 %iowait列

来源于:https://access.redhat.com/articles/325783

How to analyze and interpret sar data.
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/224923
推荐阅读
相关标签
  

闽ICP备14008679号