1847611 Members
4075 Online
110265 Solutions
New Discussion

maxswapchunks setting

 
SOLVED
Go to solution
Brando Sumayao
Advisor

maxswapchunks setting

I just created 2 additional swap devices (768mb each) on separate disks with a priority of '0'.

When I rebooted the system, I got an error on the enabling of the additional swaps. Checked the /etc/rc.log and it noted that I needed to increase the maxswapchunks parameter in the kernel. When I was creating the addt'l swap devices, it did ask me to modify the parameter of maxswapchunks (each time I added an addt'l swap). Looks like it wasn't enough.

What would be a good setting of the maxswapchunks param in my case. Again, this is my config for swap:

Physical RAM: 384mb
Primary: 768mb (separate disk/priority 1)
Secondary Swap #1: 768mb (separate disk/priority 0)
Secondary Swap #2: 768mb (separate disk/priority 0)

Thanks.
19 REPLIES 19
Sanjay_6
Honored Contributor

Re: maxswapchunks setting

Hi Brando,

Here is a link on maxswapchunks,

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

hope this helps.

Regds
Jim Turner
HPE Pro

Re: maxswapchunks setting

Hi Brando,

Increase the value of maxswapchunks to a value equal to the total size of the new swap area (maxswapchunks x swchunk).

Cheers,
Jim
Santosh Nair_1
Honored Contributor

Re: maxswapchunks setting

This kernel parameter, maxswapchunks, defines the maximum amount swap chunks (where swapchunks are defined as 2MB) available to the system. So in your case, you should set maxswapchunks to at least 1152( 1152 * 2MB = 2304MB, i.e. the amount of swap on your system). I would recommend that you set this parameter higher, e.g. 2048 , so that you don't run into problems increasing swap in the future.

-Santosh
Life is what's happening while you're busy making other plans
A. Clay Stephenson
Acclaimed Contributor

Re: maxswapchunks setting

Hi:

Assuming default swchunk (2k) and 1k blocksize; the minimum is 1152; I would set it to 2048 to give you some hreadroom in case your add more swap.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: maxswapchunks setting

John Bolene
Honored Contributor

Re: maxswapchunks setting

Max is 16384 and does not hurt to be this big.
It takes care of any future swap size.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Deshpande Prashant
Honored Contributor

Re: maxswapchunks setting

Hi
Use maxswapchunks to at least equal to swap on system.
Keeping this value even higher than existing swap will help you in future if you need to increase still more swap.

Thanks.
Prashant.

Take it as it comes.
Brando Sumayao
Advisor

Re: maxswapchunks setting

Hello all!

I set it to 2048 and it is still giving me an error in the rc.log that I have to increase the maxswapchunks parameter. Should I go up to 4096?

Brando
James Beamish-White
Trusted Contributor

Re: maxswapchunks setting

As noted above, check out http://docs.hp.com/hpux/onlinedocs/os/KCparam.MaxSwapChunks.html

However, by my calculations, a maxswapchunks of 1152 should be enough, unless my maths are somewhat lacking in the last minutes of leaving work without enough coffee. You haven't changed the kernel param swchunk from it's default have you? It should be 2048.

Otherwise, if my maths are that bad, then just tune it up (i'd probably go up in 1024 chunks) until it works.

Cheers,
James
GARDENOFEDEN> create light
Brando Sumayao
Advisor

Re: maxswapchunks setting

I maxed out my maxswapchunks setting to 16384 and it is still giving me an error generated in the /etc/rc.log stating that I need to increase the maxswapchunks param to allow paging on the swap device. My swchunk size is 2048.

Please help!!!
John Bolene
Honored Contributor
Solution

Re: maxswapchunks setting

Could you post what you see in the logfile?
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Brando Sumayao
Advisor

Re: maxswapchunks setting

Attached are the contents of the rc.log file.

Thanks!
James R. Ferguson
Acclaimed Contributor

Re: maxswapchunks setting

Hi:

If you are running 10.20, do this:

# sysdef|grep maxswapchunks

If you are running 11.x, do this:

# kmtune -q maxswapchunks

In either case, post the result, please.

...JRF...
Roger Baptiste
Honored Contributor

Re: maxswapchunks setting


Consider this:
<>

384mb is too small a memory
to worry about hitting the
swap limit. You can have
one secondary swap instead
of two. It''s a huge overkill.

Regarding your problem, check
the nswapdev parameter. if less, increase it.

But, all said, i would suggest to rethink this swap increasing strategy.

HTH
raj

Take it easy.
Brando Sumayao
Advisor

Re: maxswapchunks setting

I ran the command: kmtune -q maxswapchunks

Result was the ff:

maxswapchunks = 16384 (Current Dynamic)/16384 (Planned)

Any thoughts and thanks.

Brando
Roger Baptiste
Honored Contributor

Re: maxswapchunks setting

<>

This is a possible indication that the change was not complete. Did you use SAM to change the kernel params?? or did you go the manual route?
In that case you would need to run a kmupdate.

-raj
Take it easy.
Brando Sumayao
Advisor

Re: maxswapchunks setting

Raj,

I used SAM. Just ran the kmupdate and rebooting the server now. Will post if there are further errors.

Thanks.

Brando
Brando Sumayao
Advisor

Re: maxswapchunks setting

Works now. Thanks!