Sponsored Content
Full Discussion: Mpstat and sar
Top Forums Shell Programming and Scripting Mpstat and sar Post 302776827 by ptappeta on Thursday 7th of March 2013 02:49:50 AM
Old 03-07-2013
Mpstat and sar

HI I ma using mpstat and sar commands to check the cpu utilisation

but the results are not matching .I dont understand why thisis happening?

Code:
 
$ sar -u 12 5
Linux 2.6.9-89.35.1.ELhugemem (abcd.efgh.com)   03/07/2013
02:43:16 AM       CPU     %user     %nice   %system   %iowait     %idle
02:43:28 AM       all     41.91      0.00     57.86      0.00      0.23
02:43:40 AM       all     43.18      0.00     56.64      0.00      0.19
$ mpstat
Linux 2.6.9-89.35.1.ELhugemem (abcd.efgh.com)   03/07/2013
02:43:47 AM  CPU   %user   %nice %system %iowait    %irq   %soft   %idle    intr/s
02:43:47 AM  all   20.26    0.06   65.69    0.29    0.03    0.00   13.67   2534.05

so in this case mpstat saying 13.67% is idle where as sar is saying .19%
which one to trust
again when i use mpstat 12 5 ,it is giving correct.

Code:
 
$ mpstat 12 5
Linux 2.6.9-89.35.1.ELhugemem (abcd.efgh.com)   03/07/2013
02:44:56 AM  CPU   %user   %nice %system %iowait    %irq   %soft   %idle    intr/s
02:45:08 AM  all   36.71    0.00   63.02    0.00    0.02    0.00    0.25   1977.54
02:45:20 AM  all   38.90    0.00   60.77    0.00    0.06    0.00    0.27   3640.83
02:45:32 AM  all   38.86    0.00   60.75    0.02    0.02    0.00    0.35   2614.83
02:45:44 AM  all   67.70    0.00   32.19    0.00    0.02    0.00    0.08   2506.00
02:45:56 AM  all   62.68    0.00   37.28    0.00    0.04    0.00    0.00   1635.89
Average:     all   48.97    0.00   50.80    0.00    0.03    0.00    0.19   2474.71

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

mpstat command

I gave mpstat command in my system.. the o/p is like below CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 199 3 198 112 5 78 95 124 55 0 9 25 14 7 54 1 186 2 97 92 1 45 94 121 41 0 220 27 14 5 54 ... (2 Replies)
Discussion started by: shahnazurs
2 Replies

2. Solaris

Describe the parameters of iostat,vmstat and mpstat

Hi, I am trying to take the Statistics of the machine during load.Can someone explian the parameters of iostat: tty sd1 sd2 sd3 sd4 cpu tin tout kps tps serv kps tps serv kps tps serv kps tps serv us sy wt id vmstat: kthr ... (1 Reply)
Discussion started by: grrajeish
1 Replies

3. Solaris

VMSTAT and MPSTAT anomalies

All: I have a V445 server with four IIIi CPUs and 8 GB RAM running Solaris 10 and an Oracle database along with some app server components and we have had some performance issues - so I collected some VMSTAT and MPSTAT data over the course of three days with a 15-minute polling interval. I... (1 Reply)
Discussion started by: jeffd4d
1 Replies

4. Solaris

mpstat command

Hi, I would like to clearly understand the output of the mpstat command. What is the mutex spins and also context switches? What if we saw that the number of mutex spins is high. Basically, what to look for in the output of the mpstat command? What is wrong and what is ok. what is the value... (3 Replies)
Discussion started by: Pouchie1
3 Replies

5. AIX

topas and mpstat disagree on CPU count

I have a number of LPARs on one P520. All LPARs are running 5.3 and I observe the following: On some LPARs the number of CPUs found do not match between topas and mpstat. Server 1: $ mpstat System configuration: lcpu=4 ent=0.2 mode=Uncapped cpu min maj mpc int cs ics rq ... (1 Reply)
Discussion started by: petervg
1 Replies

6. Linux

Execution problem wid mpstat command

mpstat -P ALL 1 10 it results.. 08:05:54 PM CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s 08:05:55 PM all 0.00 0.00 0.49 0.00 0.49 0.00 0.00 99.02 1024.75 08:05:55 PM 0 0.00 0.00 0.00 0.00 0.99 0.00 0.00 ... (1 Reply)
Discussion started by: pritesh_patil
1 Replies

7. Shell Programming and Scripting

One script for Linux Monitoring-free, sar, vmstat, mpstat

HI , I am wrirting a script for checking the performance monitoring on Linux System when my application is running. I have to run a test for 30 minutes on some server and while the test is running i have to capture the perfromance metrics of Linux through vmstat , sar, mpstat, free. here is the... (3 Replies)
Discussion started by: Anamica
3 Replies

8. UNIX and Linux Applications

Graphical Representation of mpstat.out file

hi everyone, We've generated mpstat.out file monitoring cpu utilization and the file is ready now.Wanted to generate graphical charts for the same output data. Can anyone pleas suggest tool for the same.? (1 Reply)
Discussion started by: Kathraji
1 Replies

9. Shell Programming and Scripting

Mpstat script output

I have a script which runs the mpstat and prints the output in a file. In order capture highest cpu ususage from the generated output file, have to manually tail the output file and need to grab which cpu has highest value (which is very annoying) Is there a way we can automate that process of... (3 Replies)
Discussion started by: Optimus81
3 Replies

10. Shell Programming and Scripting

Need to get average idle time using mpstat

I want to get average idle time of the server using mpstat. The problem I am having is %idle is not in same columns in all the versions of linux. example 1: example 2: I tried below command as generalized solution but as Average as one less column output is not proper. I am... (1 Reply)
Discussion started by: kumarjohn
1 Replies
SA2(8)								Linux User's Manual							    SA2(8)

NAME
sa2 - Write a daily report in the /var/log/sa directory. SYNOPSIS
/usr/lib64/sa/sa2 DESCRIPTION
The sa2 command is a shell procedure variant of the sar command which writes a daily report in the /var/log/sa/sardd file, where the dd parameter indicates the current day. The sa2 command handles all of the flags and parameters of the sar command. The sa2 command is designed to be started automatically by the cron command. EXAMPLES
To run the sa2 command daily, place the following entry in your root or adm crontab file: 5 19 * * 1-5 /usr/lib64/sa/sa2 -A & This will generate a daily report called /var/log/sa/sardd It will also remove reports more than one week old. FILES
/var/log/sa/sardd Indicate the daily report file, where the dd parameter is a number representing the day of the month. AUTHOR
Sebastien Godard (sysstat <at> orange.fr) SEE ALSO
sar(1), sadc(8), sa1(8), sadf(1) http://pagesperso-orange.fr/sebastien.godard/ Linux AUGUST 2010 SA2(8)
All times are GMT -4. The time now is 07:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy