Operating System - HP-UX
1832609 Members
2456 Online
110043 Solutions
New Discussion

Re: extending primary swap onlineJFS

 
SOLVED
Go to solution
otukile
Frequent Advisor

extending primary swap onlineJFS

I have 2 clustered servers HPUX 11i with onlineJFS. Because of increased usage demand we had to increase RAM. Now we have to increase primary swap on the servers. Does anybody know how to increase this swap "on the fly" with OnlineJFS?
Don't panic
9 REPLIES 9
Christian Tremblay
Trusted Contributor

Re: extending primary swap onlineJFS

Extending swap will require a reboot.
Patrick Wallek
Honored Contributor

Re: extending primary swap onlineJFS

You can't increase the primary swap (/dev/vg00/lvol2) on the fly. LVOL's 1, 2 and 3 (/, Primary swap and /stand) MUST all be contiguous.

The better option would be to create a new swap lvol and activate it. That can be done on the fly, assuming your maxswapchunks kernel parameter is large enough.
James R. Ferguson
Acclaimed Contributor

Re: extending primary swap onlineJFS

Hi:

Increasing the size of *primary* swap is highly unlikely for the reason that the logical volume in which it resides requires contiguous allocation of its physical extents.

If you need more device swap, you *can* create it on-the-fly by creating *secondary* device swap and performing a 'swapon'.

Do something like:

# lvcreate -C y -r n -L 8192 -n lvolN /dev/vgXX
# swapon -p /dev/vgXX/lvolN

See the manpages for more information. You can do this without a reboot. Remember to add activation of the secondary device swap so built to '/etc/fstab':

/dev/vgXX/lvolN ... swap pri=0 0 0

Regards!

...JRF...

Regards!

...JRF...
Christian Tremblay
Trusted Contributor

Re: extending primary swap onlineJFS

Actually, you can increase a volume that requires contiguous allocation if you have 2 disks in your vg, but you will have to free the contiguous physical extents that are needed and assigned to another volume.

You can do this by breaking mirrors/remirroring back and forth between disks if you have Mirror-UX installed to rearrange the extents; or by using pvmove if you don't.

Of course, the easiest way is to allocate secondary swap instead of increasing primary.
Enrico P.
Honored Contributor
Solution

Re: extending primary swap onlineJFS

Hi,
you can add a secondary swap:

#lvcreate -C y -L -n lvswap2 /dev/vg00

#lvchange -r n /dev/vg00/lvswap2 (to set OFF the bad block relocation)

#lvchange -c n -M n /dev/vg00/lvswap2 (to set OFF the MWC)

#lvlnboot -d /dev/vg00/lvswap2 (make lvswap2 dump device)

#vi /etc/fstab
add the line:

/dev/vg00/lvswap2 ... swap pri=1 0 0

#swapon -a

maybe you need increase the kernel parameter MAXSWAPCHUNCKS

Enrico
Kent Ostby
Honored Contributor

Re: extending primary swap onlineJFS

You can increase swap on the fly.. you just can't decrease it on the fly.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Bill Hassell
Honored Contributor

Re: extending primary swap onlineJFS

There is no reason to extend primary swap. Just add additional swap areas with the swapon command (no reboot needed). To make the new areas permanent, add the secondary swap areas to /etc/fstab. Decades ago when RAM was measured in Kbytes and disks in Mbytes, primary and secondary swap were optimized for perforamnce (ie, priority numbers and round-robin assignments to various swap areas). But today, any significant swapping simply kills performance and must be remedied with more RAM (or less processes or less users).

After adding more swap areas, monitor the page out rate with vmstat (the po column) and if it remains below 20-30 (ideally less than 10), you have enough RAM for reasonable performance.


Bill Hassell, sysadmin
otukile
Frequent Advisor

Re: extending primary swap onlineJFS

Thank you all for your contribution. But come to think of it, the main reason why organisations buy OnlineJFS is to be able to extend/decrease filesystems on the fly. Does that mean it is still difficult to do that on lvol 1,2 and 3 after so many years? Why?
Don't panic
Bill Hassell
Honored Contributor

Re: extending primary swap onlineJFS

Extending a filesystem is VERY different than extending a logical volume. Swap is not a filesystem, it is simply a raw lvol, but because it is an extension of RAM, the lvol cannot be broken up into pieces (extended). That is a kernel requirement. /stand is a special filesystem (must be HFS) which is used by the processor ROMs and early boot code...again, it must be contiguous. / is the primary filesystem to get everything started and must also be contiguous, also due to early boot requirements. This isn't a matter of 'improving' Online JFS, it is compatibility with hundreds of models of HP9000 computers.


Bill Hassell, sysadmin