1833048 Members
2384 Online
110049 Solutions
New Discussion

Re: Increasing swap size

 
Devesh Pant_1
Esteemed Contributor

Increasing swap size

I have a server configured with the following swap space
# swapinfo - tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 35 8157 0% 0 - 1 /dev/vg00/lvol2
dev 8388 36 8352 0% 0 - 1 /dev/vg02/lv_swap1

I know that my kernel parameter maxswapchunks is set too low and is preventing me to increse the swap size.
# kmtune -q maxswapchunks
Parameter Current Dyn Planned Module Version
===============================================================================
maxswapchunks 8291 - 8291


I know of two options and maybe someone can come up with more
1. Add a third swap device of 8 gig increase the value of maxswapchunks to ??? rebuild the kernel and reboot ( preferred way but I dont have a third device )
2. Increase the size of the lvol /dev/vg02/lv_swap1 by 8 gigs ( I have the space ) change the value of maxswapchunks to ??? and reboot.
This is Online JFS - Mission Crtical OE
Suggestions ?? advise ??

thanks
Devesh
4 REPLIES 4
Bill Hassell
Honored Contributor

Re: Increasing swap size

A swap chunk is actually 2megs, so 8291 will handle 16Gb. So increasing maxswapchunks to 12000 or better yet, 16000 which will allow up to 32Gb without another reboot. As far as adding another swap space versus extending an existing lvol, it doesn't make much difference. However, extending a swap lvol will not make any difference until a reboot.

Of course, the first question is why increase swap space when your system isn't using any? Paging (sending programs and data to disk due to a lack of RAM) is always very bad for performance. There are a few database systems that require massive amounts of memory (for unknown reasons) during installation, but never need or use that space ever again.


Bill Hassell, sysadmin
Steven E. Protter
Exalted Contributor

Re: Increasing swap size

Get some more memory.

You ar overstaressing this sytem and more swap space isn't going to help, even if you find a way to do it.

Swap works a little different than other logical volumes. I've never added swap to a system without undergoing a reboot, even with onlineJFS installed.

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
Devesh Pant_1
Esteemed Contributor

Re: Increasing swap size

I know increasing swap is not the answer here but the customer wants it and they are the owners of the system. I can only try to make sense but sometimes even that doesn't help
Anyways thanks to both of you
Devesh
Bill Hassell
Honored Contributor

Re: Increasing swap size

Just to clarify about adding swap without a reboot: You can add another lvol (or more) without a reboot. Just use the swapon command. If there are not enough swapchunks available, swapon will use what it can and give you a warning about the unusable portion of the lvol. If this requirement is temporary, the space will become unused after a reboot. To make the new space permanent, you need to add the swap lvol(s) to /etc/fstab.

However, extending an lvol used for swap will not make more swap available. There is no way to notify the kernel that an existing swap area just got larger (it's nothing like a filesystem).


Bill Hassell, sysadmin