Operating System - HP-UX
1847754 Members
3951 Online
104013 Solutions
New Discussion

Re: Do i need swap if i have plenty of RAM ?

 
SOLVED
Go to solution
Sammy_2
Super Advisor

Do i need swap if i have plenty of RAM ?

I am tight on disk space but got more RAM then this application will ever need. Do I still need to have swap defined ? Hpux 11.0
Thanks
good judgement comes from experience and experience comes from bad judgement.
11 REPLIES 11
Sanjay_6
Honored Contributor
Solution

Re: Do i need swap if i have plenty of RAM ?

Hi Sam,

Check the doc at /usr/share/doc/mem_mgt.txt which tells you about the theory of swap, how the system uses it and how to configure it.

Here is a doc from itrc,

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000072951469

The itrc doc id is KBRC00001262.

Hope this helps.

regds
RAC_1
Honored Contributor

Re: Do i need swap if i have plenty of RAM ?

As a requirement, yes you need to have it. If you have plenty of RAM then you can define a very small swap space. In addition you can set swapmem_on (pseudo swap to 1) on and get away with it. The swapmem_on kernel parameter is just for kernel calculation purpose. It inflates the value of avaialble swap space to (swap space + 75 % of RAM)

Anil
There is no substitute to HARDWORK
Sanjay_6
Honored Contributor

Re: Do i need swap if i have plenty of RAM ?

Hi Sam,

Here is another useful link from itrc,

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000075563673

The itrc doc id is KBAN00000661.

Do remeber that you also need to configure dump space on the system to dump the memory info in case of a panic. Otherwise you cannot get a dump from the system during panic to analyse and find the root cause of the system panic. However the need for dump and how much dump space you need is a totally seperate headache.

Hope this helps.

regds
Bill Hassell
Honored Contributor

Re: Do i need swap if i have plenty of RAM ?

Swap space is always required but you don't need a lot. The primary swap space could be just a few hundred megs, but make sure that the kernel parameter swapmem_on is set =1. Swap is also used for memory-mapped files.


Bill Hassell, sysadmin
A. Clay Stephenson
Acclaimed Contributor

Re: Do i need swap if i have plenty of RAM ?

You need some primary swap but 256MB will do; enable pseudoswap by setting swapmem_on=1; you should really have at 0.25XMemory as swap but the remainder beyond your primary swap can even be the dreaded, awful filesystem swap set at low (higher than 1) priority. Filesystem swap doesn't even use disk space until it's actually used and eventhough filesystem swap is slower than device swap, since you ain't gonna be using it, who cares?

In modern boxes with lots of memory, your situation is very common.
If it ain't broke, I can fix that.
Sammy_2
Super Advisor

Re: Do i need swap if i have plenty of RAM ?

Thanks Sanjay for that helpful link.
RAC, Bill and Clay pretty much mentioned that one needs swap but not as much as memory as long as swapon kern is on.
Granted I need swap, but that leads me to another question:

In case of a crash, how will i get an entire coredump for hp to analyze, if I have small swap and the contents of 9GB RAM will not be able to find swap space to dump a core ?
good judgement comes from experience and experience comes from bad judgement.
RAC_1
Honored Contributor

Re: Do i need swap if i have plenty of RAM ?

First, the sap area and crash area need not to be same area. dump area can be seperate. Look at the man page of crashconf. crahconf -v will tell you how much area you may need for dumping the crash. Create a lvol a bit greater that what crashconf tells. Configure this lvol as dump area.

lvlnboot -d /dev/vgxx/lvolx
lvlnboot -R

Also configure the files /etc/rc.config.d/savecrash and /etc/rc.config.d/crashconf

Anil
There is no substitute to HARDWORK
Steven E. Protter
Exalted Contributor

Re: Do i need swap if i have plenty of RAM ?

You need a small swap area because the OS requires it.

But the old swap needs to be 2 to 3 times ram requirment is not needed.

The first time my rp5450 started to use swap and not just allocate it,management got me more memory so I could do away with that nasty performance drag.

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
Sridhar Bhaskarla
Honored Contributor

Re: Do i need swap if i have plenty of RAM ?

Hi Sam,

Now-a-days systems are supplied with atleast 18GB internal drives. A good practice is to keep non-OS related filesystems out of VG00. So, you will have a lot of space left in your root drive so it doesn't harm to create a primary swap of around 2-3GB.

While swapmem_on will take care of 75% of your swap requirements, it has to account for memory mapped pages. Also as the memory is locked by the processes and allocated dynamically by kernel etc., it will be reduced from the initial memory allocation. So, device swap has to account for that difference. Memory mapped files can increase your device swap usage in addition to 'reservations'. Memory leaks can also play an important role. So, I always like to keep atleast 75% of memory as device swap (not primary swap) in addition to swapmem_on parameter.

Not the entire memory image will be dumped. Use 'crashconf' to determine your dump requirements. Around 2-3GB of primary swap can save you dump space along with reservation requirements. If your system needs more dump space, then you have to configure a seperate area anyway.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Geoff Wild
Honored Contributor

Re: Do i need swap if i have plenty of RAM ?

This is a "that depends" answer.

It depends on the application - SAP for example, requires us to allocate 24GB of swap on a server with 10GB of ram - the swap is never used - but is a requirement.

From an O/S perspective - you need swap.

I attached a little white paper on swap and HP-UX.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Sammy_2
Super Advisor

Re: Do i need swap if i have plenty of RAM ?

Thanks to allow. I will configure a seperate device for dump. Also, from what I understand, you can run savecrash -vr /newfilesystem_with_space if you don't get a full crash
good judgement comes from experience and experience comes from bad judgement.