Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Linux Tutorials: mpstat commands examples

 mpstat - Report processors related statistics.

The mpstat command writes to standard output activities for each available processor, processor 0 being the first one.  Global average activities among all processors are also reported. 

How to install mpstat?


$ sudo apt install sysstat         [On Debian, Ubuntu and Mint]
$ sudo yum install sysstat         [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux]
$ sudo emerge -a app-admin/sysstat [On Gentoo Linux]
$ sudo pacman -S sysstat           [On Arch Linux]
$ sudo zypper install sysstat      [On OpenSUSE] 

mpstat command output

Understanding mpstat output

  • CPU : Processor number. The keyword all statistics are calculated as averages among all processors.
  • % usr : Show the percentage of CPU utilization that occurred while executing at the user level (application).
  • % nice : Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.
  • % sys : Show the percentage of CPU utilization that occurred while executing at the system level (kernel). Note that this does not include time-consuming servicing hardware and software interrupts.
  • % iowait : The CPU or CPUs were idle during which the system had an outstanding disk I / O request.
  • % irq : Show the percentage of time spent by the CPU or CPUs to service hardware interrupts.
  • % soft : Show the percentage of time spent by the CPU or CPUs to service software interrupts.
  • % steal : Show the percentage of time spent waiting for the CPU or CPUs while the hypervisor is servicing another virtual processor.
  • % guest : Show the percentage of time used by the CPU or CPUs to run a virtual processor.
  • % idle : The CPU or CPUs were idle and the system did not have an outstanding disk I / O request.

mstat commands example

1. To report the processor stats:

# mpstat 2 10 

2. To report all processor stats:

# mpstat -A 2 10 

3. To get the processor number for which the stats are displaying:

# mpstat -P 2 10 

4. To report the CPU utilization stats:

# mpstat -u 2 10 

5. To get the version info:

# mpstat -V 

To see the default set of utilization metrics, enter the following command:
mpstat 1 1

To see the default set of utilization metrics in wide display mode, enter the following command:
mpstat –w 1 1

To see the detailed dispatch & affinity metrics, enter the following command:
 mpstat –d 1 1

To see the detailed interrupts report, enter the following command:
mpstat –i 1 1

To see all the statistics, enter the following command:
mpstat –a 1 1

To see simultaneous multithreading utilization, enter the following command:
mpstat –s 1 1

To see all the processor metrics of a WPAR, enter the following command:
mpstat -@ wparname

Note: To see all the processor metrics of a WPAR inside the WPAR, enter the following command:
mpstat -@

To see the sorted output for the column cs, enter the following command:
mpstat -d -O sortcolumn=cs

To see the list of the top 10 CPUs, enter the following command:
mpstat -a -O sortcolumn=min,sortorder=desc,topcount=10

To see metrics based on the virtual processor, enter the following command:
mpstat –v

Context

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Java Installation Guide in Linux & Windows

DOWNLOAD OPEN JDK & JRE JAVA PACKAGE FROM – https://jdk.java.net/archive/ Download and Install JDK/JRE 7 in Centos & RHEL Download and Install JDK/JRE 8 in Centos &…

Read More

Linux Tutorials: Commands for Linux Administrator

1. sudo – Execute commands with elevated privileges, a fundamental for system administration. 2. useradd – Create a new user account, essential for managing user access. 3….

Read More

Linux Tutorials: How to troubleshoot Linux Server?

If a linux-build-server suddenly starts getting slow, I would divide my approach / troubleshooting into 3 section as follows; System Level troubleshooting Application Level troubleshooting Dependent Services troubleshooting…

Read More

What is Linux and use cases of Linux?

What is Linux? Linux is an open-source, Unix-like operating system kernel first created by Linus Torvalds in 1991. It serves as the foundation for a wide range…

Read More

Jenkins Tutorial: Install Jenkins on Ubuntu

In this tutorial we are going to install Jenkins on Ubuntu operating system. Ubuntu is another debian based operating system – open sourced and highly loved by…

Read More

Linux Performance Monitoring Guide

CPU Memory Network Storage Device and Input I/O Storage Capacity Storage Controller CPU Memory and I/O Interconnect Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x