The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
fre in vmstat Negm AIX 1 10-26-2006 08:53 AM
vmstat Syed_45 UNIX for Dummies Questions & Answers 2 07-27-2006 04:16 PM
vmstat big123456 UNIX for Advanced & Expert Users 4 12-21-2005 06:56 AM
vmstat anent UNIX for Dummies Questions & Answers 3 11-27-2001 10:22 AM
Vmstat DPAI UNIX for Dummies Questions & Answers 1 09-19-2001 09:55 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-18-2005
chaandana chaandana is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 49
vmstat

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 !
Chaadana
  #2 (permalink)  
Old 04-18-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,122
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 (permalink)  
Old 04-18-2005
chaandana chaandana is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 49
thanks for the clarification.
  #4 (permalink)  
Old 04-18-2005
chaandana chaandana is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 49
This could be better: (To avoid the first line)

vmstat 5 3|awk '!NR==3'
  #5 (permalink)  
Old 04-18-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,122
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0