{S} swap question

From: Becki Kain <beckers_at_josephus.furph.com>
Date: Mon, 03 Jan 2000 18:24:31 -0500 (EST)

Original question:
this is on a 250/4/266, 4.0d, with 128 meg of ram with swap in over
commit mode.

"swapon -s" says 11% of 194MB swap (22MB) is in use. but if you add up
all the "percent real memory usage" from the ps listing, it looks like
only about 25% of real memory is in use:
   % ps -e -o pmem | awk '{sum += $1} END {print "sum = " sum}'
   sum = 24.8

so if real memory is only 25% in use, why is it swapping? or is something
else using up the other 75% real memory? or am i looking at this all
wrong? or do i need another beer? basically i was trying to figure out
if we need more memory, and if so how much so that no swapping happens?
-------------------------------------------------------------------------
I've included all of the messages but the summary is basically as follows:
vmstat is better to use that swapon. Look for entries in pout column. If
there is nothing there, the box is not yet swapping.
--------------------------------------------------------------------------
From: Steve Walling <stevew_at_sodak-gaming.com>

Check out the man page for "vmstat". Until you see some activity in the
"pout' column, you're not paging out anything. The system reserves some
swap space even if its not needed. We have Oracle databases running on
our servers. I kept increasing the database buffers in memory until I saw
non zero values in the "pout" column. I then backed off a bit on the
buffer size and we very rarely page out.
---------------------------------------------------------------------------
From: "A. Mahendra Rajah, System Manager"
     <A.Mahendra.Rajah_at_Meena.CC.URegina.CA>
   Swap space is allocated to each process at process creation time
   so that they all could be swapped out just in case (think of this
   as reserved parking stalls). If all the cars came at once (ie., all
   processes are swapped out), that is the amount of parking space
   needed (swap space needed). Unless the machine is tight on memory,
   no actual swapping takes place.
---------------------------------------------------------------------------
From: "Dr. Tom Blinn, 603-884-0646" <tpb_at_doctor.zk3.dec.com>
Have you tried "vmstat -P" ? It reports on where your memory is REALLY
going inside the kernel. For instance, if you've got a large UBC use for
file I/O, then that can push not-recently-used process pages (that may be
private to the process and hence need swap) for long-running processes
(such as the X server or things of your own), that might not garbage
collect effectively or even might have memory leaks -- private pages don't
have to be in active use to be still around, after all..
---------------------------------------------------------------------------
From: Lawrence Decker <ldecker_at_pbchcd.state.fl.us>
Have another beer anyway!!!
(author's note: I work from home and this was way late at night)
----------------------------------------------------------------------------
From: Duncan Webbe <WebbeD_at_franklins.com.au>

When you are in over-commit mode isn't the swap space you're seeing as
being used just that which is reserved should it be required ? I don't
think any real swapping is going on here.
-----------------------------------------------------------------------------
From: Paul_O'SULLIVAN_at_paribas.com
More beer is required I think. VMSTAT is a better indication that you need
more memory if you get lots of swapin and swapout rates.
Unix consumes as much memory as it likes in the form of UBC - unified
buffer cache. This is a dynamically allocated area of memory.
acct will give you info on images and command lines activated etc etc
----------------------------------------------------------------------------
From: Ron Morley <morleron_at_aquinas.edu>
    What you are seeing is the amount of swap space that the system has
reserved in case it needs it. With modern Unices "swapping" is not
actually performed except under what amounts to emergency conditions.
Instead of swapping memory is paged in and out of swap space generally on
a least recently used basis. Swap space will be used by pages of
processes that have not been accessed recently. To get a better idea of
how this works take a look at vmstat. You'll see some paging activity
taking place there. This is normal no matter how much physical memory you
actually have.
    Nothing is wrong with your system. It is acting the way it's supposed
to.
----------------------------------------------------------------------------
From: Piotr Konieczny <znahor_at_venus.wmid.amu.edu.pl>
   %MEM = RSS / TOTAL_REAL_MEMORY.

You must remember that each process has virtual address size (VSZ) much
bigger than resident size (RSS). Sum of all VSZs is total usage of real
memory.
-----------------------------------------------------------------------------
From: Jim Fitzmaurice <jpfitz_at_fnal.gov>
        All available memory is always used as Universal Buffer Cache to
cache disk
reads and it gives it back as the system needs it for other things, Tru64
UNIX will swap what it considers "old" regardless. That is suppose to
prevent thrashing should memory suddenly become constrained. The "System
Tuning and Performance Management Manual" had an excellent write-up on how
Virtual Memory, (That's RAM + Swap) is managed, you should read it. (And
have another beer.)
----------------------------------------------------------------------------
From: "John J. Francini" <francini_at_progress.com>
Hmmm. Note that memory not taken up by processes is given over to the
filesystem cache. It's quite likely that this is where the majority of
the space is. The default parameters allow DU to claim as much as 80% of
system memory for the file system cache, unless it's required for process
expansion.

Of course, if a process's pages go out (because it's idle and the system
needed to expand the buffer cache), the pages will stay out until the
process revives and tries to touch those pages. This can account for the
situation where there's plenty of memory available but the swap space
isn't empty.

You may want to lower the maximum size of the buffer cache to something
more reasonable, like, say 50%.

Also note that some of the kernel and executive itself is paged, and could
be using a nonzero amount of pagefile space -- especially pages that
contain code that doesn't get executed often.

As an aside, generally, on any system 512M or smaller, I tend to allocate
double the memory in pagefile space, buttered across two or more spindles,
if possible.

Hope this helps,


John

p.s. Checked out your Web site -- those ferrets are _cute_!

Becki Kain
beckers_at_furph.com
--
  furph, Inc.	WWW/Unix/Windows Solutions	734-513-7763 (voice)
info_at_furph.com	   http://www.furph.com		734-513-7759 (FAX)
Received on Mon Jan 03 2000 - 23:25:35 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:40 NZDT