Any reason why the "sum of all" average cpu utilization numbers collected from ps during any given time sample are "consistently" lower than the corresponding numbers reported by sar (%usr, %sys). We have a Solaris O/S 2.8.
We have been trying to correlate the CPU numbers from the sar, to the processes reported by the ps for the same sampling periods, especially during periods of heavy usage. sar is set up to run every 5 seconds. We have tried to run ps every 5 seconds, and also every second, using the following script:
========================================
#!/bin/sh
while true
do
date
ps -eo pcpu,time,etime,pid,args
sleep 5
done
Either way, if we add up the "pcpu" numbers for all the reported processes for a given sample, we are as much as 30-40% short of the sar numbers for the same period, very consistently. I thought the ps pcpu numbers would reflect %usr+%sys for each process. What am I missing?
Thanks for any suggestions...