1. mpstat command 1.1 Command Format mpstat [ -A ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] [ -P { cpu [,...] | ON | ALL } ] [ interval [ count ] ]
2. Use 2.1 Output all CPU usage every 1s $ mpstat -P ALL 1 Linux 3.10.0-693.el7.x86_64 (zhanghao) February 26, 2019_x86_64_ (2 CPUs) 12:42:03 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 12:42:04 all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:04 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:041 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:04 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 12:42:05all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:05 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:051 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:05 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 12:42:06all 0.00 0.00 0.00 0.50 0.00 0.00 0.00 0.00 0.00 99.50 12:42:06 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:061 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:06 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 12:42:07 all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:07 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:071 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:07 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 12:42:08 all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:08 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 12:42:081 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
2.2 Viewing soft interrupt statistics $ mpstat -I SCPU 1 Linux 3.10.0-693.el7.x86_64 (zhanghao) February 26, 2019_x86_64_ (2 CPUs) 15:23:07 CPU HI/s TIMER/s NET_TX/s NET_RX/s BLOCK/s BLOCK_IOPOLL/s TASKLET/s SCHED/s HRTIMER/s RCU/s 15:23:08 0 0.00 5.00 0.00 0.00 0.00 0.00 0.00 2.00 0.00 4.00 15:23:081 0.00 28.00 0.00 5.00 0.00 0.00 0.00 24.00 0.00 3.00 15:23:09 0 0.00 6.00 0.00 0.00 2.00 0.00 0.00 3.00 0.00 5.00 15:23:091 0.00 26.00 0.00 70.00 0.00 0.00 0.00 24.00 0.00 2.00 15:23:10 0 0.00 16.00 0.00 0.00 0.00 0.00 0.00 12.00 0.00 3.00 15:23:10 1 0.00 13.00 0.00 6.00 0.00 0.00 0.00 13.00 0.00 1.00 15:23:11 0 0.00 18.00 0.00 0.00 2.00 0.00 0.00 14.00 0.00 3.00 15:23:11 1 0.00 12.00 0.00 5.00 0.00 0.00 0.00 10.00 0.00 1.00 15:23:12 0 0.00 8.00 0.00 0.00 0.00 0.00 0.00 4.00 0.00 3.00 15:23:12 1 0.00 30.00 0.00 40.00 0.00 0.00 0.00 19.00 0.00 4.00 15:23:13 0 0.00 7.00 0.00 0.00 2.00 0.00 0.00 3.00 0.00 3.00 15:23:13 1 0.00 23.00 0.00 7.00 0.00 0.00 0.00 22.00 0.00 1.00 15:23:14 0 0.00 11.00 0.00 0.00 0.00 0.00 0.00 7.00 0.00 6.00 15:23:14 1 0.00 30.00 0.00 12.00 1.00 0.00 0.00 25.00 0.00 8.00 15 hours 23 minutes 15 seconds 0 0.00 9.00 0.00 0.00 2.00 0.00 0.00 6.00 0.00 6.00 15:23:15 1 0.00 31.00 0.00 7.00 0.00 0.00 0.00 24.00 0.00 5.00 15:23:16 0 0.00 8.00 0.00 0.00 0.00 0.00 0.00 4.00 0.00 6.00 15:23:161 0.00 25.00 0.00 6.00 0.00 0.00 0.00 22.00 0.00 3.00 15:23:17 0 0.00 10.00 0.00 0.00 2.00 0.00 0.00 6.00 0.00 3.00 15:23:17 1 0.00 24.00 0.00 7.00 0.00 0.00 0.00 23.00 0.00 1.00 2.3 Output once every 2 seconds, output 3 times $ mpstat 2 3 Linux 3.10.0-693.el7.x86_64 (zhanghao) February 27, 2019_x86_64_ (2 CPUs) 02:13:29 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 02:13:31 all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 02:13:33 all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 02:13:35all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 Average time: all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Organize the common knowledge points of CocosCreator
>>: How to uninstall MySQL 5.7.19 under Linux
1. What is a two-column layout? There are two typ...
Preface I have been busy developing a cold chain ...
Before starting the main text of this article, yo...
Basic Concepts Current read and snapshot read In ...
Table of contents 1. Generate a certificate 2. En...
Table of contents Overview 1. Application-level m...
Zabbix Server Environment Platform Version: ZABBI...
Linux uses files as the basis to manage the devic...
Today I received a disk warning notification from...
illustrate DML (Data Manipulation Language) refer...
Table of contents Example Code Rendering Code Ana...
This article shares the specific code of JS to ac...
This is the style recommendation given by the W3C ...
Table of contents 1. Docker enables remote access...
I encountered a problem when modifying the defaul...