Operating System - HP-UX
1834750 Members
2989 Online
110070 Solutions
New Discussion

Do I have-to increase swap after I add memory to HP 11.0 server?

 
SOLVED
Go to solution
Debbie Fleith
Regular Advisor

Do I have-to increase swap after I add memory to HP 11.0 server?

I have an HP D320 server running low on memory resources and I'd like to add more physical memory to it. It currently has 128 MB of physical memory, and the swap partition is set for 256 MB.

I've always heard swap should be at least 2 x memory, but can I just add more memory and leave swap as it is?

If not, can I increase swap space without repartioning the entire system?
10 REPLIES 10
MANOJ SRIVASTAVA
Honored Contributor

Re: Do I have-to increase swap after I add memory to HP 11.0 server?

Hi Debbie

You can add memory w/o increasing the swap. Do like this

1. Add RAM , monitor the swapinfo -t , incase you find that it more swapping has started or the swap space is getting filled then add secondary swap.

2. You can add secondary swap on some othe disk ( disk on a different controller wiil be the best thing ) this can be enabled ,disabled any time and you can do it online ( enable only ) .


Moreover it all depends on the what the env of the machine is so wait after step 1.

Manoj Srivastava
Jim Turner
HPE Pro

Re: Do I have-to increase swap after I add memory to HP 11.0 server?

Hi Debbie,

Do you *have* to increase swap? No. Do I recommend you increase swap? Yes.

There are a couple of reasons. First off, if you don't have swap equal to physical RAM (pseudoswap not withstanding), you may not be able to fork procs even though you have available memory. Secondly, and this is presuming your swap is really SWAP+DUMP, you want your dump area to be at least physical RAM plus kernel so you can get a complete dump if needed.

I would recommend you create an additional 256MB of swap -- preferably on different spindle(s) from where your current swap resides. Make it the same priority as your existing swap and put it on different disks, and you will split the swap i/o.

Just my two-cents' worth. I'm sure you will get tons of other good advice here.

Have a great day!
Jim
Byron Myers
Trusted Contributor

Re: Do I have-to increase swap after I add memory to HP 11.0 server?

I agree with your assesment of at least 2 X memory for swap (ignoring psuedo swap) given you have a very small amount of RAM. As processes initiate, HP-UX reserves SWAP for them, so even though processes are not being swapped, they are consuming the swap space via reservation. So, for example, a system with 256 MB of RAM, and 256 MB of device swap (ignoring psuedo swap) allows only for about 256 MB of space for OS and other processes. configuring 512 MB of device swap here will allow for about 512 MB of OS and other processes. The memory white paper in /usr/share/doc/mem_mgt.txt is a fine document to read.
If you can focus your eyes far and straight enough ahead of yourself, you can see the back of your head.
Deshpande Prashant
Honored Contributor

Re: Do I have-to increase swap after I add memory to HP 11.0 server?

Hi
Watch the swapinfo -tM information, after adding memory, if still swapping is happening, you can add secondary swap. It can be device swap or even file system swap.
Swap equal to RAM helps, in getting dump info in case of machine crash.
I'm running N4000 machines with 11GB ram and only with 1GB swap. Machine is not doing swaping. With 11.0 I have the system dump configured for minimum information. And according to HP support, this was ok.

Thanks.
Prashant Deshpande.
Take it as it comes.
Michael Tully
Honored Contributor

Re: Do I have-to increase swap after I add memory to HP 11.0 server?

Hi Debbie,

The amount of swap space that is required
depends largely upon what applications
you are running and how the kernel is
tuned. Generally speaking days gone by
that 2 x RAM = swap was the norm.These days it is not necessary because of the reasons I've
mentioned above.

In answer to your question about increasing
swap space without repartioning the entire
system, the answer is yes, you can add swap
on the fly as a secondary swap partition.

HTH
Michael
Anyone for a Mutiny ?
Varghese Mathew
Trusted Contributor

Re: Do I have-to increase swap after I add memory to HP 11.0 server?

Hi,

Though i have seen many replies to this question, i just wanted to share someting more with u all. We have systems with RAM 6.4 GB and Swap space 20 GB. This is done as per the suggestions from SAP as SAP applications are running in our servers.
What u need to know is , about the requirement of ur application , if any.. And eventhough ur application does'nt require any more swap space , i would advise u to go for 2* the total RAM - swap space, which will help u to get enough dump space etc. in case of a disaster.

Hope this gives some idea..
Cheers !!!
Mathew
Cheers !!!
Magdi KAMAL
Respected Contributor

Re: Do I have-to increase swap after I add memory to HP 11.0 server?

Hi Debbie,

I would say that you MUST increase swap area.
In production site the value of swap area has to be 4 times the amount of physical memory.

The swap area is used when a process is inquering for resources, the entire process and all it's data segments will be put in the swap till the resource is free.

On hp-ux, a process which is intented to RESERVE swap space ( while looking for resource ) is taken into account .
If the swap area is small, you may have application faults ( not enough space !!!).



Stefan Farrelly
Honored Contributor

Re: Do I have-to increase swap after I add memory to HP 11.0 server?


You do NOT have to increase your swap if you add another 128 MB of RAM. The minimum you need is SWAP = MEMORY, not smaller. You already have 256MB of swap and only 128MB of RAM so adding another 128MB of RAM is not a problem.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Wodisch
Honored Contributor

Re: Do I have-to increase swap after I add memory to HP 11.0 server?

Hello Debbie,

it does depend upon the kind of processes which are
running on your box: X-clients do notoriously need
3 to 5 times the amount of RAM used in swap space.
Usually the two amounts are called "RSS" (resident
set size = RAM) and "VSS" (virtual set size = SWAP).
You have to subtract the sizes of kernel and buffer
cache from physical RAM to get the amount of RAM
which is "pageable" - i.e. which can be used by the
processes. The output of "dmesg" gives some clues.
But for a system as RAM restricted as yours I would
recommend at least 3 (three) times the RAM as SWAP.

HTH,
Wodisch
Vic Parker
Frequent Advisor
Solution

Re: Do I have-to increase swap after I add memory to HP 11.0 server?

Debbie,

This is a question that can be debated forever; answers will vary depending on individual experience. The Gent with the SAP application has an exceptional situation in that SAP consumes all available memory, ALL, if you add 4Gig and SAP will occupy the additional 4Gig, its the nature of the application.

No one who responded to your question asked you to check the kernel variable: swapmem_on. If this variable is set to 0, then yes swap must at equal physical memory. If still set to the default which is 1, there is no requirement for swap to equal phys mem.

Today systems can house huge amounts of memory 64GB on the new IA-64 systems. To match this with swap would not be required and crazy to go 2x phys mem. It is true that the system will reserve but today this is minimal thanks to virtual memory facilities.

Having done dump analysis, I can tell you that there is no need to dump the entire phys. mem content to disk. The kernel is dump first and that typically will fit in dump space with no prob. Having the kernel dumped for analysis is enough in my book to do a post-mortem, the register contents are what's important here.

Keep an eye on glance, swapinfo or whatever you choose to monitor system resources for depletion. But, you should not feel compelled to match phys mem with an equal amount of swap.

In my humble opinion,
Vic
code your own, or follow the rules