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. Prepare the environment (download nodejs and s...
Since Alibaba Cloud's import of custom Ubuntu...
Windows 10 1903 is the latest version of the Wind...
MySQL is a relatively easy-to-use relational data...
Effect Preview Press the "Click to Preview&q...
Table of contents 1. Why NanoID is replacing UUID...
1. Click Terminal below in IDEA and enter mvn cle...
1. Radio grouping As long as the name is the same,...
Table of contents Create a new user Authorize new...
This article shares the specific code of jQuery t...
EXPLAIN shows how MySQL uses indexes to process s...
In order to provide high availability of the netw...
Nginx is a high-performance website server and re...
Through JavaScript, we can prevent hyperlinks fro...
1. Inline styles To add inline styles to the virt...