LOGIN
Sign In or Register
Avatar
Not Registered Yet?

Join Now! It's FREE. Get full access and benefit from this site

Reset My password - Remind Me My username

Username
Password
Remember me

20 mpstat Commands Examples in Linux / UNIX

If you are using SMP (Multiple CPU) system, use mpstat command to display the utilization of each CPU individually. 
 
mpstat Report processors related statistics which includes Collecting and displays performance statistics for all logical processors in the system.. This display CPU statistics of individual CPU (or) Core.
 
How to install mpstat?
1. Ensure you are logged in as 'root'
'mpstat' and 'vmstat' are apart of the 'sysstat' package and should be installed by default
2. Verify installation :
# rpm -qa | grep -i sysstat
3. Installation, if needed :
# rpm -ivh <name>
4. If you have connectivity to RHN or a Satellite Server:
# yum install sysstat
5. If you are using Ubantu:
# apt-get install sysstat
 
Usage:

1. Using mpstat command without any option, will display the Global Average Activities by All CPUs.
$ mpstat
 
2. Using mpstat with option '-P' (Indicate Processor Number) and 'ALL', will display statistics about all CPUs one by one starting from 0. 0 will the first one.
$ mpstat -P ALL
 
3. To display the statistics for N number of iterations after n seconds interval with average of each cpu use the following command.
$ mpstat -P ALL 2 5
 
4. The option 'I' will print total number of interrupt statistics about per processor.
$ mpstat -I
 
5. Get all the above information in one command i.e. equivalent to "-u -I ALL -p ALL".
$ mpstat -A
 
Reference
http://linuxcommand.org/man_pages/mpstat1.html
Rate this item
(0 votes)
Rajesh Kumar

.

Total, Over 12 years of extensive experience in the Software Configuration Management domain having depth knowledge of DevOps, Continuous Integration and Delivery, Configuration Management, Build and Installer, Release Management and Application Management.

What corporate management say about us?

Rajesh touched a lot of Devops topics and resolved a lots of related queries and doubts. The mentoring method is really smooth and helpful.

Sohit Malik
I'm a Software Engineer, Noida
Sep 02, 2016