Operating System - HP-UX
1834722 Members
2318 Online
110069 Solutions
New Discussion

Re: how to extend swap area?

 
praveen..
Super Advisor

how to extend swap area?

Hi,
I have SWAP space of 20 / 24 GB on my server.
as SWAP should be 1.5 times the size of RAM.

# vgdisplay -v /dev/vg00 | more
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 11
Open LV 11
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4328
VGDA 4
PE Size (Mbytes) 16
Total PE 8636
Alloc PE 7873
Free PE 763
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0


# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4096 0% 0 - 1 /dev/vg00/lvol2
dev 20480 0 20480 0% 0 - 1 /dev/vg00/swap2
reserve - 17469 -17469
memory 32735 19715 13020 60%
total 57311 37184 20127 65% - 0 -


can i extend my swap space?
can i extend my VG00?
what is /dev/vg00/lvol2 file system, is it also swap space bcoz it is in swapinfo.

how to extend my swap space?


4 REPLIES 4
Jeff Schussele
Honored Contributor

Re: how to extend swap area?

Hi,

No you can't expand primary swap - it must be 100% contigous with / & /stand
All you need to do is create a secondary swap LV on another disk or LUN.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
A. Clay Stephenson
Acclaimed Contributor

Re: how to extend swap area?

You simply need to add additional swap space but it can be in any volume group. By the way, who told you that swapspace needs to be 1.5X memory? If you have .25x memory and swapmem_on=1 then you may have plenty of swap. The "real" rule these days is to configure a small amount of swap and then monitor swap usage. The performance impact of significant swapping is so huge that your goal should be not to swap at all.
If it ain't broke, I can fix that.
Ninad_1
Honored Contributor

Re: how to extend swap area?

Praveen,

First let me answer your questions.
1. can i extend my swap space? - Yes, but depends on few kernel parameters (maxswapchunks*swchunk define the total amount of swap space you can have apart from nswapdev which defines how many swap devices you can have.)
My suggestion - From the outputs you have shown it does not seem to me that you require swap space as it is not being used. Generally its true to have 1.5 times memory as your swap, but these days you have a large amount of memory and its not always required to have 1.5 times swap as long as you have swap atleast = memory.
Other thing from the output of swapinfo - it seems the kernel parameter - swapmem_on is 1 in your system - check thru SAM - this means you can use your memory as pseudo swap instead of adding more swap space.

2. can i extend my VG00? - Yes, if you have more disks, you can add into VG00.
Suggestion - its not necessary that you have your swap device in VG00 and if you have space elsewhere you can create swap device there also - but swap needs contiguous space. Also as i said I dont feel you need more swap space, unless your system is giving you error messages saying you need swap.

3. what is /dev/vg00/lvol2 file system, is it also swap space bcoz it is in swapinfo. - yes it is also a swap space.

Hope this clarifies,
Ninad
Victor Fridyev
Honored Contributor

Re: how to extend swap area?

Hi Praven,

As far as I see, you have two swap partitions on the same physical disk. This is very bad configuration, which can reduce performance of the server significantly.
So my recomendation is to remove swap2 partition and, if you really need additional swap space, to build it on another disk. If you don't have additional disks, backup your computer with make_tape_recovery and restore it with increased swap space.

HTH
Entities are not to be multiplied beyond necessity - RTFM