Re: why the difference in swap value for vmstat output

From: Darren Dunham (ddunham_at_redwood.taos.com)
Date: 11/14/03


Date: Thu, 13 Nov 2003 23:56:24 GMT

In comp.unix.solaris Bill <bill12317@lycos.com> wrote:
> All,

> I am looking into a performance issue in one of our servers and need
> some help to understand the output of vmstat and top as I am now
> totally confused.

> The machine is a Sun Enterprise Server running Solaris 8, with 40G of
> RAM and 56 G of disk swap

WOW! 56G of disk swap? What are you doing with this box that makes
that useful? Normally if that much stuff is swapped out, you've got
performance issues.

, which means I have about 90 G of swap.
> Checking the output of vmstat -p 5, I have the following, I
> understand, the swap + free - RAM used by kernel, but I expect

> a. swap + free will be close to 90G, but 57 + 3 is close to 60G, can
> anyone explain why does my swap go ?

The first is free swap (VM) and should agree with 'available' in swap -s
output. The second is free RAM. Free RAM counts in both columns.

> b. I understand the swap or free will be changed, but I explect to
> total of swap + free be the same, but why did it go from 60 G (57 + 3)
> to 70 G ( 62 + 8) ?

5GB of RAM was freed for some reason.

> c. I used to think that only high number for sr means a memory
> shortage,

On Solaris 8 and higher, that's generally correct. Actually *any* sr
would point to that.

 but
> what if my system is a database server using a lof of file system, and
> given we have high fpi, will we be benefited by increasing more disk
> swap, so as to cache more file system ?

Filesystem pages are cached in free RAM, they're not swapped to disk so
increasing your disk backing store should have no effect on file system
caching.

> The following is the top output ...

> ===============================================================
> Memory: 36G real, 7199M free, 33G swap in use, 60G swap free
> ==============================================================

> From what I understand from the man page,
> therefore the above it means that out of the 36G of RAM, about 29G had
> been used, right ? because it shows 7 G is free.

Looks right to me.

> does it also mean that 33G of disks swap is being used? because

> "swap in use" is the amount of swap area on disk that is being used
> "swap free" is the amount of swap area on disk that is still
> available.

If you use 'swap -l' to measure swap on disk in use, it is more clear.

> Does the 33G swap include physical RAM ?

Probably. Compare it to 'swap -s' which does include physical RAM.
 
> I thought I understand swap here, but after looking at the data for a
> few days, I am confused. thanx for the help

'swap -s' looks only at the unified VM space and tells you allocation
within it.

'swap -l' looks only at disk swapfiles and tells you how much is used.

-- 
Darren Dunham                                           ddunham@taos.com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >


Relevant Pages

  • Re: swap size for 2gb 2 processors?
    ... out a partition magic run on a 120 gb disk, ... The rule of thumb is 2 * RAM size, in your case that would be 4G. ... price for a swap partition has remained reasonably constant. ...
    (comp.os.linux.misc)
  • Re: [ck] swap prefetching merge plans
    ... After I close some memory demanding aplication that caused huge portion of the memory to be swapped out to disk, the time needed to swith back to firefox or eclipse is really really shorter. ... And software engeneerers and programmers are really working hard to eat all your RAM even if you think that "now you have really much". ... I have so much swap because I am compiling I my packages on tmpfs. ...
    (Linux-Kernel)
  • Re: VM system - memory seems to be running out, when its not
    ... No extra RAM allocation would occur until the pages are used. ... amount of RAM as a swap space. ... The VM space can have a dedicated area on disk. ...
    (comp.unix.solaris)
  • Re: headsup: swap_pager.c
    ... disk could not keep up with page-in demand. ... "add" another disk while the box is spasticly trying to swap ... around a 200M plus working-set into 32M physical RAM. ... bash me more...I still dont understand why you are trying to fix ...
    (freebsd-arch)
  • Re: why the difference in swap value for vmstat output
    ... > RAM and 56 G of disk swap ... The second is free RAM. ... < This line left intentionally blank to confuse you. ...
    (comp.sys.sun.admin)