Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers vmstat
# 1  
Old 04-18-2005

When I exeute vmstat (e.g. vmstat 30 2),
in some machines I get some wierd result as the first line.
like: -117% or 208% for CPU idle percentage.
But the second line is alright.
Could someone explain this please.

Thanks !
# 2  
Old 04-18-2005
vmstat obtains some counters from the kernel. Then it waits a second, then it obtains the counters again. At this point, it can tell you what happened over the past second. When it prints that first line, it doesn't have any previous history. So many of the values on the first line are useless. Some versions of vmstat suppress that first line.
# 3  
Old 04-18-2005
thanks for the clarification.
# 4  
Old 04-18-2005
This could be better: (To avoid the first line)

vmstat 5 3|awk '!NR==3'
# 5  
Old 04-18-2005
Maybe, but some of the stuff isn't computed by subtracting the previous values. And now you have to wait 5 seconds to see anything.

Also, the previous history was supposed to initialed to zero. So that first line was supposed to be an "average" since the system was booted. Today's systems are fast so those 32 bit counters wrap around too much for that. And when one counter wraps and another didn't, calculations involving multiple counters get screwy. I still see references to the first line serving as an average since boot, but this doesn't work anymore.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux


I m checking idle time using vmstat, below are the results var=$(ssh wmtmgr@$hostname vmstat | tail -1 | awk '{print $15}') 89 and now im subtracting 89 with 100 & im getting expected results expr 100 - $var 11 Now How can I get the result 11 in one line code? (4 Replies)
Discussion started by: sam@sam
4 Replies

2. Solaris

Vmstat | nawk

I'm trying to parse vmstat output with this: vmstat | nawk '/0/{printf "%s\ \n", $5}' but output is different on two sparc Solaris 10 servers, one is missing line with 'free'. why ? (3 Replies)
Discussion started by: orange47
3 Replies

3. AIX

Need guidance on VMStat

I need some guidance on the differences in observations, not sure how significantly different are they. Also, It would be nice to hear on the values and what the obvious tuning for performance missing. Observation 1 ending vmstat -v 3948544 memory pages ending vmstat -v ... (1 Reply)
Discussion started by: Snipper
1 Replies

4. Shell Programming and Scripting


Hi I need to write a script to display VMSTAT every 5 seconds and I just need the memory columns - swap free re and just the numbers and the headers arent required. For example bash-3.00$ vmstat 5| awk '{print $4" "$5" "$6}' disk faults cpu ------ This header isnt required swap... (3 Replies)
Discussion started by: kapilk
3 Replies

5. Linux

vmstat help

Hi everyone, I need to see some VM manager performance/behavior information on some Linux boxes regarding pages scanned/activation of the paging algorithm in order to get an idea if a given server needs more memory and is actually paging. In Aix servers, by using the vmstat cmd you... (1 Reply)
Discussion started by: jcpetela
1 Replies

6. Solaris

Huge PI in vmstat

This is something nowbody around me can explain: vmstat (-S 5) shows a huge number of PI but when I try to monitor it in parallel with iostat - there is no IO activity to be seen that would correspond to this. I have 16G RAM and 32G swap file. I'll really appreciate if somebody can explain it.... (9 Replies)
Discussion started by: dkvent
9 Replies

7. UNIX for Dummies Questions & Answers


Hi I wanted to collect data by using vmstat -I 60 >xxxx.txt & using my own account It was stopped by it self after 2 hours try again same result We want to collect day date by succession how to collect data using vmstat for day Thank you (2 Replies)
Discussion started by: Syed_45
2 Replies

8. UNIX for Advanced & Expert Users


Hi, what does mean the free colomne in out put of vmstat ? is it free espace of physical memory or of swap space on hard disk ? Thank you (4 Replies)
Discussion started by: big123456
4 Replies

9. UNIX for Dummies Questions & Answers


Hi, In the unix command, "vmstat" we get information on Page memory. what does the "mf" - "minor fault" is? Regards, Anent (3 Replies)
Discussion started by: anent
3 Replies

10. UNIX for Dummies Questions & Answers


I have MATLAB INSTALLED IN MY SUN MACHINE >> WHENEVER I USE IT THE CPU USAGE SHOWS ABT 90% Seeing the vmstat shows that system calls and context switch counters reach a very high value . What are these counters ( Man pages do not give much info on that) .... The only thing i can make out that... (1 Reply)
Discussion started by: DPAI
1 Replies
Login or Register to Ask a Question

Featured Tech Videos