1833861 Members
2032 Online
110063 Solutions
New Discussion

Swap management

 
SOLVED
Go to solution

Swap management

Hi all,
My company has purchased a fine new rx7640, and came preinstalled with HP-UX B.11.23 .
This machine should be used totally ( no virtualization ) for one application. The guys from the software company have some idiot swap memory requirements. The machine has 32gig of memory and they want us to allocate 1.5 times the amount of memory for swap. A total of 48gig of swap. I cannot make it clear to them that this is some old manner ( unknown to me ) o swap space allocation.
Can one of you link me to the documentation that proves ( to my reseller ) that his requirement is not a useable value.

I'll quote the email that he sent me back.
"In Unix, when a process requests some memory - say 1MB from the
operating system, the OS allocates that amount of memory to the process
and also reserves a corresponding amount of swap space on the swap
device in case that process ever needs to be swapped out. SV needs a lot
of swap due to the fact that it uses a lot of shared memory segments -
If 15 processes all share a 1MB data segment then you will consume 1MB
of memory and will reserve 15MB of swap in case any of those processes
need to get a private version of the segment.
The recommendation still stands at 1.5 times physical RAM."
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: Swap management

Shalom,

I'll give you the knowledge of an experienced administrator.

On a system with 32 GB of memory, it is unlikely that you will need 48 GB of swap.

The minimum swap/dump (if consolidated on the same logical volume) is 50% of RAM. This is to accommodate a memory dump.

Going lower than 50% of RAM is known to make HP-UX unstable.

All processes that open reserve swap, and if swap is too small, you may run into trouble openning processes.

The link you want:
http://docs.hp.com/en/B2355-90672/ch06s03.html
http://safari.oreilly.com/0131433490/ch08lev1sec10

The recommendation is wrong. I'd do between 50% of RAM and 100% of RAM depending on how much memory will actually be used on the system.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Swap management

Their reasoning is correct --- as far as it goes. This is the reason for HP's pseudoswap (swapmem_on=1). Unless pseudoswap is enabled, if you had 8Gib of device swap, for example, you could only reserve space for 8GiB of processes eventhough you have 24GiB of RAM free. Pseudoswap (which is nothing more than kernel bookkeeping) allows 75% of RAM to be counted as process reservation space. In this case (0.75 x 32GiB RAM) + 8 GiB Device Swap would allow you to use the entire 32GiB as process reservation space.

These days, it is very common for boxes to have much less memory than swap --- and that is a perfect use for pseudoswap. I would start out with 8GiB of swap and monitor swap usage. As long as you leave some unconfigured space (and it doesn't have to be in vg00), it's so easy to add additional swap that it's not worth worrying about. One point: Make sure every dab of your swap is mirrored --- this has the effect of making your 1.5X requirement grow to 3X. Remember, you bought all that memory so that you would never have to swap. Why allocate disk that is never going to be used?
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: Swap management

Sorry, missed an important link:

http://h71028.www7.hp.com/ERC/downloads/c00792791.pdf

Deals with superdome systems which commonly have huge memory.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
whiteknight
Honored Contributor

Re: Swap management

Maurice,

Having the swap space > 1.5 times usually standard recommendation by HP. Further, it is also for performance robustness.

Take a look on the performance cookbook, hope this will help.

WK

please assign points



Problem never ends, you must know how to fix it
VK2COT
Honored Contributor

Re: Swap management

Hello,

Having large swaps used to be popular and was driven by old technologies and software.

After dealing with numerous projects, I
adopted the following stance and it has not failed me:

a) Primary swap is 4 GB (maximum 8 GB
if there is enough space on boot disks).

b) Create dedicated dump device.
If enough space, dedicated dump volume
equals RAM size, or between 1/2 and 3/4
of it.

Dedicated dump device will not shorten the
time required to write from memory to dump
during the crash, but WILL SHORTEN the
reboot time.

Think what happens at crash time typically:

1. Memory image gets dumped into swap/dump area.

2. At reboot, due to risk of swap
overwriting those dump pages, savecrash
"exports" them into the crash dump directory
(typically /var/adm/crash).

That way, you can keep an image in the dump
area until the next crash or run
savecrash at will.

On a server with large amount of RAM, this is
a serious problem because the reboot
can take a loooong time. That is a huge
risk because the golden rule of system
administration is: restore production
services AS SOON AS POSSIBLE and then
analyze the root cause.

So, with 32 GB RAM (or more - I worked
on much larger servers too), set up primary swap of 4 or 8 GB only, then set up a
dedicated dump volume of say 24 GB, mirror
them. Enable pseudo-swap.

If ever, for some weird reason you
run out of resources, either add more RAM,
or create secondary swap (ideally same
size as primary swap - that is best
for performance). The secondary swap MUST
not and SHOULD NOT be on the same physical
disks as primary swap.

So far, this has never failed me.
Maybe I have been lucky for the last
23 years :)

Cheers,

VK2COT
VK2COT - Dusan Baljevic

Re: Swap management

Thanks for all the comments!
It really helped me.
The other thing that I need to use is a seperate crash partition, thanks for that hint.

Cheers Maurice.