Operating System - HP-UX
1833759 Members
2471 Online
110063 Solutions
New Discussion

Extending swap space under HP 11.00

 
Michael W
New Member

Extending swap space under HP 11.00

Have a couple of questions concerning swap space:

1) What are the steps to extend our swap space mounted under /dev/vg00/lvol2?
2) If we extend it, do we have to reboot the server or can it be utilized immediately?

Thanks.

-- Michael
12 REPLIES 12
DCE
Honored Contributor

Re: Extending swap space under HP 11.00



Rather than extending the existing swap space, add an additional lvol and specify it as swap. this can be done either via command line, or via SAM.

Increasing swap this way, the new swap space is available immediately (no reboot required)
James R. Ferguson
Acclaimed Contributor

Re: Extending swap space under HP 11.00

Hi:

You will not be able to extend your primary swap space in the sense that you think of extending a standard logical volume. That is, primary swap is a contiguous logical volume and hence requires that its physical disk extents occur without gaps in allocation. Since 'lvol3' (the root filesystem) follows immediately, you can't extend 'lvol2'.

The solution is simply to add a secondary swap space.

Regards!

...JRF...
Robert-Jan Goossens
Honored Contributor

Re: Extending swap space under HP 11.00

A. Clay Stephenson
Acclaimed Contributor

Re: Extending swap space under HP 11.00

... and you may have to increase the kernel tunable "maxswapchunks" before you can utilize all of your new swap space.
If it ain't broke, I can fix that.
Michael W
New Member

Re: Extending swap space under HP 11.00

Ok, I am just a little confused. The primary goal is to extend the swap space (either the primary or creating a secondary) without having to reboot the server.

Current layout:
$ bdf | grep vg00
/dev/vg00/lvol3 143360 34233 102417 25% /
/dev/vg00/lvol1 295024 58120 207400 22% /stand
/dev/vg00/lvol8 872448 551356 308904 64% /var
/dev/vg00/lvol7 901120 736500 154354 83% /usr
/dev/vg00/u01 3481600 3182121 280805 92% /u01
/dev/vg00/lvol4 65536 30385 33361 48% /tmp
/dev/vg00/lvol6 704512 686565 16828 98% /opt
/dev/vg00/lvperl58 225280 78540 137598 36% /opt/perl-5.8.0
/dev/vg00/oracle 409600 293270 109085 73% /opt/oracle
/dev/vg00/lvol5 102400 92826 9047 91% /home

$ sudo swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1024 83 941 8% 0 - 1 /dev/vg00/lvol2
reserve - 941 -941
memory 2544 1935 609 76%
total 3568 2959 609 83% - 0 -

$ vgdisplay
--- 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 2500
VGDA 4
PE Size (Mbytes) 4
Total PE 4338
Alloc PE 4034
Free PE 304
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

VG Name /dev/vgap0
VG Write Access read/write
VG Status available, exclusive
Max LV 255
Cur LV 79
Open LV 79
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4331
VGDA 4
PE Size (Mbytes) 4
Total PE 6944
Alloc PE 3417
Free PE 3527
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

VG Name /dev/vgex3
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 3
Open LV 3
Max PV 16
Cur PV 3
Act PV 3
Max PE per PV 3473
VGDA 6
PE Size (Mbytes) 4
Total PE 10416
Alloc PE 7490
Free PE 2926
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

/dev/vg00 = Primary system information
/dev/vgap0 = SAN mapped drive environments
/dev/vgex3 = SAN mapped drive environments

The future plan is that the /dev/vg00/u01 mount would disappear in the near future as the Oracle database is being migrated to the SAN environment. In the meantime, we need a quick and dirty way to increase the swap space on the server to allow our 3rd party applications (i.e. apache, etc) to utilize the system more efficiently.

So would the following work?:
lvcreate -L 1000 -C y -r n -n auxswap /dev/vg00
swapon /dev/vg00/auxswap

then modify the /etc/fstab to show:
/dev/vg00/lvol1 /auxswap swap defaults 0 1

Or am I missing something?
A. Clay Stephenson
Acclaimed Contributor

Re: Extending swap space under HP 11.00

Your fstab entry should be:

/dev/vg00/auxswap ... swap pri=2 0 0

or something close to that BUT this will only work if maxswapchunks is big enough to allow the additional swapspace.

Adding swap space will not allow you system to run more efficiently. It will allow more processes to run. If your page out rate is significant then the work "run" will be more like "crawl".
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Extending swap space under HP 11.00

Hi (again) Michael:

I'd bit a bit more fussy and specify:

swapon -p 0 /dev/vg00/auxswap

...which assigns a higher swap priority to your secondary swap. In this fashion, *if* you ever do I/O for swap, you use one device and *then* the other; not both on the same disk at the same time --- a potential head-banger.

Your 'etc'fstab' entry should also look like:

/dev/vg01/auxswap ... swap pri=0 0 0

Regards!

...JRF...


Michael W
New Member

Re: Extending swap space under HP 11.00

There is only the vg00 volume group w/ only 2 HDs in the server. There are no plans to add more hard drives at this time. The other vg mounts are to the SAN, which to my understanding cannot have swap based on it.

As for the maxswapchunks variable, can this be seen via the command line?

-- M
James R. Ferguson
Acclaimed Contributor

Re: Extending swap space under HP 11.00

Hi Michael:

'maxswapchunks' is a kernel parameter. At 11.0, use SAM or 'kmtune' to view and/or tune.

Regards!

...JRF...
Mridul Shrivastava
Honored Contributor

Re: Extending swap space under HP 11.00

use kmtune |grep maxswapchunks to see the current value of this parameter if OS is 11.11.

If it is 11.23 you need to use kcweb.
Time has a wonderful way of weeding out the trivial
Michael W
New Member

Re: Extending swap space under HP 11.00

Ran the following:

$ kmtune | grep -i maxswap
maxswapchunks 512

$ sudo swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1024 83 941 8% 0 - 1 /dev/vg00/lvol2
reserve - 890 -890
memory 2544 1848 696 73%
total 3568 2821 747 79% - 0 -

Does that mean, even though the swapinfo is showing 1GB already, that only 512mb of it is actually being allocated to processes?

A. Clay Stephenson
Acclaimed Contributor

Re: Extending swap space under HP 11.00

The "memory" line is pseudoswap and represents space reserved for processes. You are actually using 8% of 1GiB as swap space. You need to run vmstat and look at the page out rate; if that is significant (above ~ 15-20/s or so) for anything more than brief periods (minutes at most) then you really need more memory. If you add more swap space, virtual memory will be increased but your page-out rate will rise as the machine loads and your performance will drop to a crawl as you see the po rate hit 100/s or so.
If it ain't broke, I can fix that.