Operating System - HP-UX
1838092 Members
3142 Online
110124 Solutions
New Discussion

Re: Increasing Swap Space

 
Lisa Moore
Advisor

Increasing Swap Space

How can I increase the swap space already configured on my K460 without adding it to another disk?
8 REPLIES 8
MANOJ SRIVASTAVA
Honored Contributor

Re: Increasing Swap Space

Hi Lisa

You need to free some partitions as definatley you need extra space , since you are not adding disk free , move a partition and then just add swap using SAM and in case you have online JFS installed then you dont even have to shut id down . It is better to have the swap on two differnt disks/controllers for better perfomnace issues.

Also typically the thumb rule is to have atleast the same swap size as you have the memory.


Manoj Srivastava
Vincenzo Restuccia
Honored Contributor

Re: Increasing Swap Space

#lvcreate -L xxx /dev/vg00
insert in /etc/fstab:
/dev/vg00/lvolxx ... swap pri=2 0 0
#swapon -a
#swapinfo -mt (verify)
Try also with SAM.
Lisa Moore
Advisor

Re: Increasing Swap Space

I don't want to lvcreate, because I don't want another logical volume. What about lvextend of lvol2? What are the ramifications?

AND IF I choose to add another lv, can I add it to an external drive?
A. Clay Stephenson
Acclaimed Contributor

Re: Increasing Swap Space

Hi Lisa,

You have one other option and that is to enable filesystem swap. This is normally not a good idea for performance reasons (but then for performance reasons I never want to swap anyway). You can configure some filesystem swap at VERY low priority so that it is not used until all your device swap is used so that you don't take as big a hit as you might think. Using it this way means that a lot of disk that normally goes unused can be used for other things.

man 1m swapon for details
but you would do this my
1) create a swap directory; e.g. mkdir /u02/fsswap
2) swapon -m 0 -l 32000 (for example) -r 1000 -p 5 /u02/fsswap

Note especially the low priority 5.

This is especially useful when you can't create a logical volume and you need swap NOW.

Food for thought, Clay
If it ain't broke, I can fix that.
Rita C Workman
Honored Contributor

Re: Increasing Swap Space

Hi Lisa,

Increasing swap...so many things you could say or ask here. First: lvol2 is established when you first ignite the system. There is an unsupported method for reducing lvol2, but I am not aware of one to increase it except to re-ignite.
Adding physical (disk) swap should never be done on the same disk that has vg00...it defeats the system and can cause disk thrashing. You always want to add disk swap space to a different physical disk and configure it with lvols at about the same size as lvol2 (suggested this way, but not a requirement).
Now filesystem swap is another option and I believe that was mentioned...again it will slow you down.
Anytime you rely on physical devices like disks (which includes f/s swap) than the i/o factor of devices is going to impact your overall system performance.
My preference is (if you have enough memory) to configure/tune your parms; enable pseudo swap and keep your swapping strictly in memory. It improves system performance greatly by keeping your swapping in memory and not paging out to disk.
That said...have you tried monitoring your system using the sar commands. When you see peak periods run some of these. Like a sar -w 1 60....or if your running Oracle check and see if your slowing down because your semm* parms are too low and your waiting because nothing is freed up yet (sar -mS 1 60).
If a system is going slow, disk swap maybe is not always the answer. Double check your parms.....good tuning will often buy you much better performance.

Just my 2cents,
Rita
Lisa Moore
Advisor

Re: Increasing Swap Space

Thanks Rita! I'm currently reading "Managing Swap and Dump" in docs.hp.com. That has intructions and suggestions about pseudo-swap that are worth me exploring a little more.

Thanks, everyone, for your help!
Mladen Despic
Honored Contributor

Re: Increasing Swap Space

Lisa,

If you want to increase the size of /dev/vg00/lvol2, to say, 1 Gb, you could run:

lvextend -L 1000 /dev/vg00/lvol2

However, due to contiguous allocation policy for swap volumes, you need to have enough disk space on disk IMMIDIATELY after lvol2.

You can try the following:

1. Run 'lvdisplay -v /dev/vg00/lvol2 | more' and note disk device(s) under "PV Name"

2. Let's say the disk device for lvol2 is /dev/dsk/c0t1d0. Then run 'pvdisplay -v /dev/dsk/c0t1d0 | more' and note the sequence of physical extends on this disk. You will likely see physical extents for lvol1, lvol2, lvol3 in that order.

On most systems, there will be no free physical extents IMMIDIATELY after lvol2, becuase lvol3 is "in the way".
In this case

lvextend -L 1000 /dev/vg00/lvol2

will FAIL.

So...........

1. you could move lvol2 to another part of disk, or to another disk, where there will be enough disk space to extend lvol2 contiguously (easily done with MirrorDiskUX - if you need further details, let us know)

2. you could move lvol3, lvol4, ... to another area of the disk, or to another disk, until there is enough free disk space IMMEDIATELY after lvol2

3. you could, instead, create one or more swap devices on other disks (yes, you can use external disks). There are steps for doing this in:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x018cee3e323bd5118fef0090279cd0f9,00.html

Unless your /dev/vg00/lvol2 is really small, I would recommend using option #3 for performance reasons.

HTH
Bruce Regittko_1
Esteemed Contributor

Re: Increasing Swap Space

Hi,

Mladen is correct that extending your primary swap will be difficult, at best. Why is it you don't want to create a new device swap logical volume? Having another swap volume on another disk (and ideally, another controller) will not only increase the available swap but improve swap performance.

You should also check to see if the swapmem_on kernel parameter is set to 1. If so, pseudo swap will be enabled. Let us know what you do,

--Bruce
www.stratech.com/training