[HPADM] RE: -SUMMARY- Clarification on swapinfo/glance output

From: Naylor, Jim (Jnaylor@Schnucks.com)
Date: Tue Jan 27 2004 - 14:22:20 EST


Original question at end. Thanks to Steve Hamilton, Sundar Swaminathan,
Laurentiu Simion, Kenneth and Maythe Ray, and Bill Hassell for the helpful
information. Their explanations follow:

Memory allocation under HP-UX can be a little odd, and sometimes tools like
Glance and 'swapinfo' help, and sometimes, they just make it worse... ;-)

Basically, HP-UX "pre-allocates" (reserves) swap space for every process
that runs, when the process starts. The idea is to make sure that if/when
the system needs to swap out a portion of that program, it will have room to
do so. Because of this philosophy, once you have reserved 100% of your
configured swap space, you will no longer be able to run more programs (they
will get the "out of space" error)...

HP-UX also utilizes the amount of RAM in the system as though it were swap
space - it basically adds approx. 75% of the amount of installed RAM to the
pool of swap space. We call this "pseudo-swap" - it is never really used as
swap space, it just increases the available pool of swap space so that we
can run more programs at the same time.

Pseudo-swap is kind of tracked by the "memory" line is 'swapinfo', although
my
experience leads me more to believe that the memory line tracks closer to
what's actually used of the memory available to processes.

In your case, I trimmed the output a little to see it better:
# swapinfo -t
 Kb Kb Kb PCT
TYPE AVAIL USED FREE USED
dev 2097152 0 2097152 0%
reserve - 1468224 -1468224
memory 3299740 1220268 2079472 37%
total 5396892 2688492 2708400 50%

You currently have 2GB of swap space configured on a system that has 4 GB of
RAM - is that right?

In order to use all of the physical RAM in a system, you need to have swap
space to back up the programs that you will be running in that memory. In
your case, you should have at least as mush swap space configured as you
have RAM - you can even have more without any problems. Typically, we
recommend that folks configure 2X or 2.5x RAM in swap space.

One potential limitation that you might run into is the value of the kernel
parameter "maxswapchunks" - check it and make sure that it is set to at
least 2048 in order to have 4 GB of swap space...

For more information, check out the Memory Management Whitepaper in
/usr/share/doc/mem_mgt.txt...

I hope that this helps somewhat - please don't hesitate to let me know if
you have any other questions. I'd be happy to pass on anything else that
might help understand this...

--
Steve Hamilton
__________________________________________________________________________
    You have 2 GB of device swap configured in the system and apparently
4 GB of total
Physical memory installed in the system ?
    The pseudo swap (memory line in the output) is enabled by default by
the kernel
parameter swapmem_on. Since u have relatively huge amount of memory, it
makes sense
to have the pseudo swap enabled.
    Amount of memory reserved as pseudo swap is determined dynamically
at boot up and is
normally setup at 75% of the total physical memory installed in the
system.
    As a whole u have more than 2.7 GB of free swap space available in
the memory and 
I am sorry but I could not really think of any reason why oracle will
run out of space
    Look at the memory management white paper in ITRC.
Thanks,
Sundar Swaminathan
__________________________________________________________________________
You do have swap configured on /dev/vg00/lvol2 for a total amount of 2Gb.
The total amount of physical memory in the system is 4Gb.
First you should allocate 2 more Gb of disk space to /dev/vg00/lvol2 to
bring the swap where it should be (to be safe and if you have the space
available).
Since you do use pseudoswap (memory as swap) you should disable it
(swapmem_on = 0) and you will start getting more accurate readings for the
memory. 
There are differences in glance memory reporting between 11 and 11i (what do
you use?). With 11i and pseudoswap disabled you should get the 
proper mem values in glance.
If the memory showed 100% then you had the pseudoswap full and since the
disk swap usage was 0% the system is not using the disk swap. After making
swapmen_on as 0,
check to see the swapusage. Be sure you run a swapon -a after the reboot.
Regards,
Laurentiu Simion
____________________________________________________________________________
_______
Seems to me you need to increase your swap by adding another device swap, it
seems that your Oracle instance is needing to reserve more swap area. The
memory line of swapinfo isn't actually physical memory it is pseudo swap.
Other than the memory line showing up in the swapinfo command you can also
see that your system has pseudo swap turned on by looking at the kernel
parameter swapmem_on. If you run    kmtune -q swapmem_on  it should be set
to 1. You might want to search for pseudo swap to get a good understanding
of what it is, but in short it is about 75% of your physical RAM that is
magically available so processes can reserve space for starting. The key
thing is that it actually doesn't take up any of your physical
memory....again you should read about it.
I think creating another device swap that is probably about 1.5 times the
size of the actual physical memory you have should help, also you might need
to adjust some of the Oracle SGA parameters to be more inline with the
amount of physical memory you have on the system.
If I had that occurring that's where I'd start....
Kenneth and Maythe Ray
____________________________________________________________________________
___
Swapinfo is not an easy tool to understand. The metrics are from
kernel locations that require internal system knowledge to figure
out. The problem you are having with Oracle is likely due to reasons
that are not related to actual RAM but addressing limits imposed by
kernel parameters, environment limits or program limitations:
 - kernel parameters maxdsiz and maxdsiz_64 (note: maxdsiz_64 must
   always be larger than maxdsiz) are much too low.
 - ulimit is preventing large memory programs from getting more RAM.
 - Oracle is only 32bits and shared memory (SGA) has become fragmented
   from stop/restarts of Oracle and/or multiple instances.
Start by adding 4Gb of temporary swap (leave it out of /etc/fstab)
using swapon. Then run Oracle (and all instances). You'll now have
about 7Gb of virtual memory. If Oracle just needs more RAM, it
should run OK now. If it still fails, then one or more of the above
limits are causing the problem.
--
Best regards,
Bill Hassell 
___________________________________________________________________________
Thanks,
Jim Naylor
Unix Systems Administrator
Schnuck Markets, Inc.
* Direct: (314) 994-4784
*)) Cell: (314) 691-0186
* Fax : (314) 994-4684
* jnaylor@schnucks.com
-----Original Message-----
From: Naylor, Jim 
Sent: Tuesday, January 13, 2004 3:31 PM
To: Hpux-Admin@Dutchworks. Nl (E-mail)
Subject: [HPADM] Clarification on swapinfo/glance output
Hello All,
I have been reading several entries in the archives explaining the output of
swapinfo in regards to memory and device swap but apparently I am having a
mental block because I can't seem to comprehend the explanations.  Here is
my output form swapinfo -t:
# swapinfo -t                                                              
                     Kb              Kb             Kb     PCT       START/
Kb                      
TYPE        AVAIL        USED        FREE     USED        LIMIT
RESERVE      PRI      NAME           
dev         2097152               0     2097152         0%              0
-           1     /dev/vg00/lvol2
reserve                  - 1468224     -1468224
memory  3299740    1220268      2079472        37%
total        5396892   2688492       2708400        50%             -
0           - 
Before re-booting this machine the "memory" line showed 100% and the "dev"
seems to always show 0% as if it is never using the device swap space.  With
"dev" line at 0% I am getting errors from oracle saying out of space and
eventually the system is un-usable.  In glance it shows swap at 100% (40% of
it is "R" I assume for reserved) and memory in glance was showing 76%.  If
someone could explain this output in layman's terms or point me to a white
paper that could explain it, I would greatly appreciate it.                
Thanks,
Jim Naylor
Unix Systems Administrator
Schnuck Markets, Inc.
* Direct: (314) 994-4784
*)) Cell: (314) 691-0186
* Fax : (314) 994-4684
* jnaylor@schnucks.com
--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact
majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner:
owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse
only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse &
search)
--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:38 EDT