Main Page | Report this Page
Linux Forum Index  »  Linux Setup  »  Units for vmstat and top?...
Page 1 of 1    

Units for vmstat and top?...

Author Message
TonyV...
Posted: Tue Oct 20, 2009 2:37 pm
Guest
Okay, this is bugging me. I can't find any documentation on what
units vmstat and top are reporting their data in. A couple of
examples:

On my web server, I see the following data for an apache2 thread:
VIRT: 330m, RES 36m, SWAP: 294m, SHR: 24m

On top's man page, it says:

VIRT -- Virtual Image (kb)
SWAP -- Swapped size (kb)
RES -- Resident size (kb)
SHR -- Shared Mem size (kb)

So what does the lower-case "m" mean? My first thought was
"megabytes," but why wouldn't it use the more traditional capital M
instead? And I have around a hundred apache2 processes running at any
given time servicing requests, each fairly typical of the example line
given above. Does that mean that Apache is using up 30 GB of virtual
memory in all: = (330 MB per process - 24 MB shared) * 100 processes /
1024 GB per MB? I find that really hard to believe, since I only have
a GB of physical memory plus a 2 GB swap partition.

So if it's not MB and the units really are kb, what is the lower-case
"m" for, and what does it mean when a metric doesn't have it following
it?

Also, vmstat's man page gives zero information on the units repoted.
Here's a typical vmstat metric:
procs r: 1, b: 1; memory swpd: 42716, free: 23720, inact: 211380,
active: 725808;; swap si: 2, so: 5; io bi: 37, bo: 35; system in: 51,
cs: 58; cpu us: 3, sy: 1, id: 79, wa: 17

Okay, so some of those metrics have units of blocks. But what about
the memory metrics? According to the vmstat man page, for example,
memory swpd is the amount of virtual memory used. ...In --!!? I
mean, without some kind of unit after it, that sounds like I have
708.8 kB of active memory, which is silly.

I'm trying hard to get to the root of an apparent memory problem I'm
having on my server, trying to figure out how much I need based on how
much is being used during busy times, and troubleshooting a problem
I'm having where it looks like the virtual memory starts inexplicably
thrashing, as well as trying to tune Apache and MySQL to best use the
physical memory I have. But without knowing what the numbers actually
mean, it's really hard.

Thanks in advance for any help!
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Mon Nov 30, 2009 8:27 am