CPU usage accuracy puzzlement
I'm trying to write a script to capture the CPU usage for a particular server. I have tried iostat, vmstat and top, but in batch mode they always give a consistent value. For example, if I just run 'iostat -c' once, it will return the same value, no matter how many times I run it. However, if I use 'iostat -c 1 5' for example, the first value returned will be that same value, but the remaining values will fluctuate wildly.
The same behaviour is also observed with vmstat and top -b.
Can anyone tell me whether this is normal behaviour?