Operating System - HP-UX
1834047 Members
2487 Online
110063 Solutions
New Discussion

what is the quickest way to increase swap space

 
mike worrell
Regular Advisor

what is the quickest way to increase swap space

Just spoke with HP RC and it was suggested that I increase swap space. What is the quickest way to do that, is it as simple as going to single user mode and using sam or is it more involved.
thanx
mike
10 REPLIES 10
harry d brown jr
Honored Contributor

Re: what is the quickest way to increase swap space

The quickest way is to use filesystem swap.

/usr/sbin/swapon -l 5000 -r 10000 -p 2 /paging

do a man on swapon


man 1m swapon


live free or die

harry
Live Free or Die
Eugen Cocalea
Respected Contributor

Re: what is the quickest way to increase swap space

Hi,

First you have to make sure you have space to extend it, ie unpartitioned space. If not, it will be more complicated since you will have to reduce the size of some other partition and increase the size of the swap.

E.
To Live Is To Learn
James R. Ferguson
Acclaimed Contributor

Re: what is the quickest way to increase swap space

Hi Mike:

You can add more device swap without having to reboot (assuming that you have a sufficient value for 'maxswapchunks' already defined for your kernel.

You can use SAM if you like. Ideally, construct a secondary device swap that is the same size as your primary, but on a different disk, and set its priority to the same as the primary's. In this way, you will achieve interleaving and improve performance.

Regards!

...JRF...
mike worrell
Regular Advisor

Re: what is the quickest way to increase swap space

thanks for the info
by the way it is currently 1024mb
and space available in vg00 is 26752mb.
should there be any problem increasing it using sam
mike
Rita C Workman
Honored Contributor

Re: what is the quickest way to increase swap space

Mike,
If the 1024 mb of space is lvol2...than you do not want to increase your swap by increasing lvo2. lvol2 is set when you ignite a box..the space here must remain contiguous...and to add space here is very involved and tricky.
If you are going to add disk swap than you want to ensure that the new swap will be on a seperate disk device. So, make sure where you create your new swap_lvol that it is. And yes you can add this via SAM.


Rgrds,
Rita
A. Clay Stephenson
Acclaimed Contributor

Re: what is the quickest way to increase swap space

Hi:

No SAM should be fine for that. If your try to add too much swap space you may receive a warning about needing to increase maxswapchunks and rebuild the kernel. If vg00 is consists of one 1 disk or 2 strictly mirrored disks then make certain that you do not assign priority 1 (that of primary swap) to your new swap space. If you do that primary and new swap will be interleaved on the same disk and you can imagine what the head positioning mechanism would be doing. Equal priority is desired if the swap is spread over multiple devices but definitely not desired if spread over one.

Clay
If it ain't broke, I can fix that.
Roger Baptiste
Honored Contributor

Re: what is the quickest way to increase swap space

Mike,

Since you have space in
Vg00, you can create a new
device swap partition there as
follows:

lvcreate -L Size -C y -n swap1 /dev/vg00
(size in Mb)
swapon /dev/vg00/swap1

If you want this to be'
permanent across reboots,
edit the fstab file and
add the entry
/dev/vg00/swap1 ... swap pri=1 0 0

# do a swapinfo -mt to see
whether the swap is enabled
and being used.

For more info, do a man on
swapon

HTH
raj
Take it easy.
linuxfan
Honored Contributor

Re: what is the quickest way to increase swap space

Hi Mike,

Another thing, once you add your swap device, make sure you add the entry to the /etc/fstab

/dev/vgxx/lvoly ... swap defaults 0 0

(man fstab for more information on adding entries to the fstab)

Otherwise the next time you reboot the machine, the additional swap won't be configured.

-Regards
Ramesh
They think they know but don't. At least I know I don't know - Socrates
mike worrell
Regular Advisor

Re: what is the quickest way to increase swap space

thanks to all for your help
i created another lv /dev/vg02/swap
and it increased maxswapchunks for me.
swapinfo showed it being used and thus far
my problem hasn't returned.
Again thanks everyone
Have a great week
:-))
MIke
Sanjay_6
Honored Contributor