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?
$ 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.
$ 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