Reputation: 7900
when I issue the vmstat command without any parameter I get this result:
# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
7 117 0 719328 1251624 258624672 0 0 346 64 0 0 4 0 92 3 0
As you can see cpu idle is 92 percent. No matter how many time I issue the command, I get similar results.
But when I issue vmstat with a time interval parameter, cpu idle value falls down immediately:
# vmstat 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
385 0 0 145380064 1457188 115708528 0 0 346 64 0 0 4 0 92 3 0
417 0 0 144694256 1457204 116388928 0 0 0 49 1122 528500 84 5 12 0 0
413 0 0 143960640 1457220 117117040 0 0 0 31 1127 529619 84 5 11 0 0
418 0 0 143224224 1457228 117850080 0 0 0 26 1114 530135 84 5 11 0 0
444 0 0 142483520 1457240 118587048 0 0 0 33 1112 530314 84 5 11 0 0
397 0 0 141820240 1457256 119245040 0 0 0 37 1114 531348 85 5 10 0 0
Here it is! Even if I get results in 5 secs interval, cpu idle value falls about 80 percent!
I can't imagine if vmstat itself consume this much CPU power ( server has 32x Inter Xeon X7550 CPUs each has two 2 cores and 2 threads).
Can someone give me a clue about that %80 Cpu power I loose?
Upvotes: 1
Views: 2274
Reputation: 86
The first stat output by vmstat gives you the average stat since the machine last boot up (whether you specify time delay or not). When you specify time delay, the subsequent stats shows you the stat of the machine between each interval. For example, say you specify time delay of 5 seconds, the first stat shows you the stat since the machine was last booted up. The second stat shows you the stat 5 seconds after it reports the first stat. The 3rd stat shows you the stat 5 seconds later after the 2nd stat.
Upvotes: 7
Reputation: 7900
From the man page:
If no delay is specified,
only one report is printed with the average values since boot.
Upvotes: 1