1834277 Members
1874 Online
110066 Solutions
New Discussion

maxswapchunks

 
Andrew Brain or Yong Ji
Occasional Advisor

maxswapchunks

HP9000 K250 OS11.00, with 1Gb phy memory

I have 512mb of swap space on my server, but the server was running slow. I was advised to increase the kernel parameter 'maxswapchunks' from 385 to 1000. Although afterwards the machines performance got worse and started to report the error "Insufficient Memory or swap space, or stack size exceeded massiz". We are going to purchase more memory for the server, but in the short term I'm going to increase the swap space to 1Gb, but what should I make the 'maxswapchunks' value?
Plus if I increased it to 2Gb what should the value be?
I'm spinning around
5 REPLIES 5
Andy Monks
Honored Contributor

Re: maxswapchunks

maxswapchunks is in units of swchunk (which is 2MB). Therefore with it set to 1000 like you have, you can have upto 2GB of swap.

If your getting stack size errors, you probably want to look at the parameter maxssiz.

Also, worth looking at mazdsiz too.

Changing the maxssiz,mazdsiz won't have any performance effects (it just raises/decreaes limits).

To be honest I'm surprised adding more swap space had an effect.

Can you post the output from 'swapinfo -tm' ?
Jim Mulshine
Frequent Advisor

Re: maxswapchunks

You might be able to get some more usable memory by changing the kernel parameter dbc_max_pct (default=50 percent) to something lower like 20 percent. If you have never changed this parameter then it should be set at using 50% of the system memory as a dynamic buffer cache. On your system that equates to 256MB.
CHRIS_ANORUO
Honored Contributor

Re: maxswapchunks

The MAXSWAPCHUNKS parameter has nothing to do with system performance. It is okay as you have set it, it contributes to swchunk. It only helps increase the limite of allowable swap space. to add to Andy's contribution.
Use this values for you kernel to resolve the is at hand:
allocate_fs_swapmap=0
dbc_max_pct=25
dbc_min_pct=5
bufpages=0
nbuf=0
maxdsiz=1gb
maxtsiz=1gb
shmmax=1gb
swapmem_on=1


Cheers!
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Matt Griffin
New Member

Re: maxswapchunks

I believe that in order to figure this out you will need to know 2 parameters, maxswapchunk and swchunk. Swap space is figured as (maxswapchunk x swchunk x DEV_BSIZE[1]) = swap space. swchunk will read in KB's. 1024KB=1MB...
Defaults are maxswapchunk=256
swchunk=2048 (2 MB)
DEV_BSIZE=1
In this case, if swchunk is still set at 2048, setting maxswapchunk to 512 would be 1GB and maxswapchunk=1024 would be 2GB.
RikTytgat
Honored Contributor

Re: maxswapchunks

Hi,

MAXSWAPCHUNKS defines the upper limit of swap you can have. Multiplying MAXSWAPCHUNKS with the size of a swapchunk (SWCHUNK) results in the maximum amount of swap possible.

This means that, even when you have configured your system with more swapspace, the system won't use more than MAXSWAPCHUNKS*SWCHUNK.

So, to be able to use more swap, you have to
1) increase MAXSWAPCHUNKS
2) create additional swap devices or increase existing swap devices.

Bye,
Rik.