Showing results for 
Search instead for 
Did you mean: 


Go to solution
Steve Camarata
Occasional Visitor


Does anyone know if vmstat correctly reports cpu utilization in a multi-CPU environment?

Mohamed K Ahmed
Trusted Contributor

Re: vmstat

It is better to use the command sched_stat
and you can see at the end of its execution the CPU usage for every CPU

vmstat shows the usage for all CPU, but I am not sure if it is correct or not.
you have to run it for some time... like vmstat 1 10, becasue if you ran it once, you will see a comulative stats

use sched_stat better

Valued Contributor

Re: vmstat

your better off using collect, which will give you the follwing information per CPU.
( Since you haven't mentioned anything about OS level and version , I'm assuming Tru64 V5.1A > )

Per CPU Section
CPU# Index for scripts.
USER Percent time (ticks) spent in user-level code.
This includes nice ticks.
SYS Percent time (ticks) spent in kernel.
IDLE Percent time (ticks) spent doing nothing.
WAIT Idle ticks while waiting for I/O to happen.

Hope this Helps,
Honored Contributor

Re: vmstat


vmstat gives only the overall usage of CPU, Memory et all

#/usr/bin/vmstat -p

gives clearinfo about processors
never give up
Joris Denayer
Respected Contributor

Re: vmstat

As far as I know, the vmstat output is correct in multi-cpu systems. The cpu figures are indeed global figures.
This is the average of the sys,user,idle,(wait) times of all cpus.
If you are interested in per CPU statistics, then go for sched_stat or use "collect -sp"

To err is human, but to really faul things up requires a computer
Hein van den Heuvel
Honored Contributor

Re: vmstat

The answer is 'yes of course'.
Why do you ask?
What makes you think there might be a problem?
And if you really think is it a bug, it would be required to know the OS version and patch levels.
What is the 'real problem' you are trying to solve?

in addition to the previous replies, which are all useful, sometime 'top' is the best smp display tool. Myself I like 'monitor' but that is harder to find.

Steve Camarata
Occasional Visitor

Re: vmstat

Thanks for the info. We are behind on upgrades, so we are at 4.0F. The vmstat output was sufficient to show daily load for the request for new servers.

Thanks again for all the info.