1836462 Members
1854 Online
110101 Solutions
New Discussion

Re: Adding Swap Space

 
Vito Sarducci
Regular Advisor

Adding Swap Space

I need to configure more swap space. I have lvswap2 (5GB), lvol2 (1.5GB), and lvswap3 (5GB) for a total of 11.5 GB.
My kernel parameter maxswapchunk is set to 8192.

I am adding another 10 GB of memory into my N4000-55 server. What are the proper steps to get it there with what i have already configured for swap space?

Do I need to adjust any other kernel parameters besides maxswapchunk and what size for that one as well?

Please advise?

thanks,

Vito
Lifes too short to stress out, Enjoy every day you have on earth!
12 REPLIES 12
James Beamish-White
Trusted Contributor

Re: Adding Swap Space

You probably don't need more swap space. The old rule of swap = 2 x physical memory does not apply when dealing with the sizes you are talking about. I would suggest that you instead put the memory in, and then monitor your system to see if you are actually using swap and by how much (swapinfo), and then adjust accordingly.

Cheers,
James
GARDENOFEDEN> create light
Helen French
Honored Contributor

Re: Adding Swap Space

Hi Vito:

I would suggest you to do this through SAM. It will be very simple; go to disk devices, select disk, create swap space and SAM will tell you the correct value of the kernel parameters that needs to be changed.

You can also do it through command line. For finding out the maxswapchunk value, check this formula:

http://www.docs.hp.com/cgi-bin/otsearch/getfile?id=/hpux/onlinedocs/os/KCparam.MaxSwapChunks.html&searchterms=maxswapchunks&queryid=20020415-072853

You need to restart the server after doing this.

HTH,
Shiju

Life is a promise, fulfill it!
harry d brown jr
Honored Contributor

Re: Adding Swap Space

Read this:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x048c5220af9bd5118ff10090279cd0f9,00.html

I'd probably use filesystem swap, but that's me.

live free or die
harry
Live Free or Die
Vito Sarducci
Regular Advisor

Re: Adding Swap Space

This is to James, I dont understand what you are meaning by your reply that the amounts Im trying to configure is not within the old rule? Please define?

Thanks,

Vito
Lifes too short to stress out, Enjoy every day you have on earth!
James R. Ferguson
Acclaimed Contributor

Re: Adding Swap Space

Hi:

It would appear that you will need to increase your 'maxswapchunks' value. I calculate that your current limit is about 17GB (assuming a standard value for 'swchunk':

http://docs.hp.com/hpux/onlinedocs/os/KCparam.MaxSwapChunks.html

I would consider setting 'swapmem_on' too, if not already done.

Regards!

...JRF...
Wim Rombauts
Honored Contributor

Re: Adding Swap Space

Something I would look at is the values of dbc_max_pct and dbc_min_pct if you use them.
(nbuf and bufpages should be 0 in that case)

If you add 10GB of memory and need it for running applications and not for extra filesystem buffercache, you need to recalculate the value of these parameters so that the maximum amount of buffer cache is approx. the same siez in MBytes (or GBytes).
James Beamish-White
Trusted Contributor

Re: Adding Swap Space

Hi again,

You stated "I am adding another 10 GB of memory ". To me that means physical memory, is this correct?

My statement was presuming that you are adding physical memory to a machine, and want to increase swap space to allow for the possibility of needing more swap because you have more memory.

Cheers,
James
GARDENOFEDEN> create light
Vito Sarducci
Regular Advisor

Re: Adding Swap Space

the answer is yes to your question James. I am adding another 10GB of physical memory to my N4000 server running 11.0

So besides changing maxswapchunk in SAM, is there anything else I need to do? please advise?

thanks,

Vito
Lifes too short to stress out, Enjoy every day you have on earth!
Sandip Ghosh
Honored Contributor

Re: Adding Swap Space

What is the current utilisation of your swap? It seems that you have already 11.5 GB of swap. Can you please let us know the Configuration of your N4000 like the No. of CPU and the RAM Size. And if possible post the output of swapinfo -tm.

Because in general if you are having good amount of RAM you do not need that high amount of Swap.

Sandip
Good Luck!!!
James Beamish-White
Trusted Contributor

Re: Adding Swap Space

Hi again Vito,

So, if you are adding another 10GB memory, how much will the new total be? And how much swap are you currently using (can you please post the output of swapinfo)?

But in answer to your original question... thinking along the lines of you already having 5GB memory - if you follow JRFs link, you will be able to find the formula for maximum swap using swchunk, maxswapchunks and DEV_BSIZE (1024). Once you know what you want for your new swap value (lets say 20GB for now), you allocate some free disk (using SAM -> Disks and File Systems -> Logical Volumes) to be an appropriately sized swap volume. Then you again use SAM (Disks and File Systems -> Swap) to allocate that to swap.

But again, I do not think you will need more swap that your existing 11.5GB. I suggest doing some performance monitoring of swap use before you possibly waste disk.

Hope this helps.

Cheers,
James
GARDENOFEDEN> create light
S.K. Chan
Honored Contributor

Re: Adding Swap Space

To answer your question, no. Summarizing what others have said. Parameters that need changes ..
1) maxswapchunk = a must
2) swapmem_on = depends, only enable pseudo swap if you do not intend to configure your swap to equal or more than physical memory
3) dbc_max_pct and dbc_min_pct = depends, only if you want to allocate more/less buffer cache.
pap
Respected Contributor

Re: Adding Swap Space

Hi do following thing.

1. Suppose your total physical memory is X
then adjust the value of maxswapchunk as per the formula.
X=maxswapchunk*swchunk.

Keep the variable as maxswapchunk so your new maxswapchunk will be X/swchunk

X is in MBs.in above case.

2. Now if you have X MB of physical memory, then keep swap space same as that of Physical memory..i.e X MB.

Now you can have idea where , what needs to be changed. Accordingly id you are short of swap space, then you can add device swap to your machine.

Thanks,
-pap

"Winners don't do different things , they do things differently"