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
Preface lvm (Logical Volume Manager) logical volu...
What are XHTML tags? XHTML tag elements are the b...
When you log in to MySQL remotely, the account yo...
The one I wrote before is too complicated, let’s ...
I installed MySQL on Windows by unzipping the com...
Table of contents 0. Background 1. Installation 2...
A sophomore asked me how to install and configure...
question Insufficient memory when docker installs...
How to allow remote connection in MySql To achiev...
HTML structure <body> <div class="w...
Copy code The code is as follows: <!DOCTYPE HT...
For some systems with large amounts of data, the ...
Preface If the query information comes from multi...
Table of contents Overview The role of reverse pr...
Before talking about CSS priority, we need to und...