Operating System - HP-UX
1832982 Members
3881 Online
110048 Solutions
New Discussion

Re: How to increase swap?

 
SOLVED
Go to solution
dictum9
Super Advisor

How to increase swap?


I have 6 GB of swap, I would like to increase it. Do I need online JFS?
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: How to increase swap?

Since I assume that you don't want to use filesystem swap, OnlineJFS is meaningless in this context. Simply create an additional LVOL (mirrored preferably), add a swap entry in /etc/fstab, and execute swapon -a. You can also use SAM to do all of this. You may need to increase the kernel tunable, maxswapchunks, and build a new kernel to be able to use the additional swapspace.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor
Solution

Re: How to increase swap?

Hi:

No. Add a new swap device space:

# lvcreate -C y -r n -L 8192 -n lvolX /dev/vgNN
# swapon -p 0 /dev/vgNN/lvolX

Then, add the following to '/etc/fstab':

/dev/vgNN/lvolX ... swap pri=0 0 0

No reboot is necessary.

Regards!

...JRF...
Chauhan Amit
Respected Contributor

Re: How to increase swap?

Primary Swap - You will have to use Ignite Backup/Restore to increase the same. Online JFS will not be of any help.

Otherwise as suggested above , Create a seconday swap with required space.

It would be better, if you create that on another disk than that of primary swap.

Also seconday swap can be anywhere, it could be in vg01 also.

-Amit
If you are not a part of solution , then you are a part of problem
Chauhan Amit
Respected Contributor

Re: How to increase swap?

Here are some of the Thumb rules for creating secondary swap:

a) Avoid file system swap altogether if possible.
b) Avoid using busy file systems such as the root file system.
c) Avoid using file systems already near capacity.
d) Avoid using file systems on disks that already have swap configured.
e) Set priorities appropriately.
f) Choose faster devices over slower devices.
g) Choose infrequently-used file systems over busier file systems.

Regards,
Amit
If you are not a part of solution , then you are a part of problem
Chauhan Amit
Respected Contributor

Re: How to increase swap?


maxswapchunks * swchunk * DEV_BSIZE = max swap space
If you have the default values of swchunk and DEV_BSIZE with maxswapchunks of 1536 it should give you about 3.2 GB of swap since setting this parameter is only going to cost you a reboot, fix it high enough for future needs af swap so 5000 should bring you to about 10GB...

swapon will only work if you are adding a new swap device...
If you are not a part of solution , then you are a part of problem
dictum9
Super Advisor

Re: How to increase swap?

quote:

Avoid using busy file systems such as the root file system.

What do you mean by that? My current swap is setup in the vg00 volume group. Should I create another volume group for that additional swap?



Chauhan Amit
Respected Contributor

Re: How to increase swap?

Reply is Inline:

quote:

Avoid using busy file systems such as the root file system.

What do you mean by that? My current swap is setup in the vg00 volume group. Should I create another volume group for that additional swap?

- Above statement means that you shouldn't use same disk to create secondary swap. You can use any other existing Volume Group such as vg01/vg02 to create secondary swap. It will enhance performance of the system.
By creating another swap on the same disk will hamper performance.

-Amit
If you are not a part of solution , then you are a part of problem