HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Adding SWAP space on system

 
Mohammad Sanaullah
Frequent Advisor

Adding SWAP space on system

Dear All
I am facing some memory issue and need to increase the swap space.
I came to know that it is not possible to increase the primary swap and need to add secondary swap, fresh swap requirement is upto 10 GB.

# model
ia64 hp server rx6600
OS: HPUX B.11.23

# vgdisplay vg00
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 9
Open LV 9
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 4356
VGDA 2
PE Size (Mbytes) 32
Total PE 4322
Alloc PE 3968
Free PE 354
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 10240 855 9385 8% 0 - 1 /dev/vg00/lvol2
reserve - 9385 -9385
memory 40930 39682 1248 97%
total 51170 49922 1248 98% - 0 -

Please let me now:
1. Can I increase the primary swap
2. If not how to increase the swap on system. using above free space. Please let me know the procedure, does it requires system reboot or any application downtime.

Mohammad Sanaullah
Alive
14 REPLIES
TTr
Honored Contributor

Re: Adding SWAP space on system

1. Not easily
2. Add secondary swap using the available space on vg00. See http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=&threadId=451429 or search for "add secondary swap"
Pete Randall
Outstanding Contributor

Re: Adding SWAP space on system

You can simply add another swap area and set the priorities equal. Probably the easiest way to accomplish this is to use SAM.


Pete

Pete
Steven E. Protter
Exalted Contributor

Re: Adding SWAP space on system

Shalom,

1. Take an ignite backup of vg00. Boot from backup and intervene at the ignite interface to recover with a large swap area.
2. Create a secondary swap area, with sam or command line, activate the swap and reboot the system to complete the process. lvcreate then lvextend -L

A reboot is always required to permanent swap space. You may be able to avoid this by going with an additional file system based swap but this has performance impact.

Note: Creating a swap space larger than twice ram will impede performance. As you have 40 GB of RAM, the minimum recommended total swap space should be 20 GB total.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ganesan R
Honored Contributor

Re: Adding SWAP space on system

Hi Mohammad,

>>>1. Can I increase the primary swap<<<

No, you can't. The reason is that swap filesystem should be contigious.


>>>2. If not how to increase the swap on system. using above free space. Please let me know the procedure, does it requires system reboot or any application downtime.<<

You need to create additional/secondary swap.

If you are not familiar with command line use SAM to create secondary swap. use the below steps.

Creating additional swap :

Findout which volumegroup(VG) is having enough free space using vgdisplay command.

For VG01 use the following command. Look at the values of Free PE and PE size.
PE size*No of Free PEâ s is the space available on that VG

#vgdisplay /dev/vg01

Create the logical volume for your secondary swap.

#lvcreate -L 10000 -n swap -C y -r n /dev/vg01 ->Here the size is 10GB

Once you created the logical volume use SAM to configure it.

#sam
Disks And File Systems
Swap
Actions ->Add Device Swap
Using the Logical Volume Manager

Select the lvol from the list of Unused Logical Volumes

/dev/vg01/swap

select:
When to Enable
[X] Now
[X] At Every System Boot
OK

Then system will rebuilt the kernel and reboot the system.

This is the default selection





Best wishes,

Ganesh.
James R. Ferguson
Acclaimed Contributor

Re: Adding SWAP space on system

Hi:

This question comes up repeatedly.

1. This is not worth the effort to do it when you have a configuration in which you can. Secondary device swap is perfectly good as primary device swap.

See this recent thread:

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1318283

Regards!

...JRF...
Avinash20
Honored Contributor

Re: Adding SWAP space on system

In your case 9385 / 10240 is being already reserved, i.e, application reserve the space in case if page-outs take place.

But if the memory pressure is high and if free memory is very less to run new process, then there is no use in increasing swap.

You could check the free memory available via

# top

Check the Memory section,,, (XXXX K Free)

Your answers"
1. Take ignite and restore ignite. recommended one, as told above
2. Please create a secondary swap

lvcreate -L 10240 -n myswap -C y -r n /dev/vg00

This will create a LV /dev/vg00/myswap

# swapon -p 1 /dev/vg00/myswap

You could see this swap added via
# swapinfo -tam

Add it to fstab to have it activated across reboot

echo "/dev/vg00/myswap ... swap pri=1 0 1" >> /etc/fstab
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: Adding SWAP space on system

Hmmm...

44 of 116 points assigned.

Please try to assign points to the thread.
This is a better ways of saying Thanks.
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Shahul
Esteemed Contributor

Re: Adding SWAP space on system

Hi,

To answer your question, Yes, you can increase primary swap. but I would not recommend as it is a complex procedure and require down time. The easiest option is to assign secondary swap as follows. You have got around 11GB free space in vg00.

#lvcreate -L 11328 /dev/vg00
#vi fstab and add a line as follows.

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

here nn is the lovol number. Then
#swapon -a (To enable all swaps in fstab)
#swapinfo -t (To verify)

Make sure that swchunk parameter in Kernel is already set to a large value.

Good luck
Shahul
Mohammad Sanaullah
Frequent Advisor

Re: Adding SWAP space on system

Thanks for all the responces, Points I will surely give to all.

While I am trying to create a logical volume so that I can use the same for swap is giving error to undistribute your volume group, as this system is a node for two node cluster, and I need to add swap space on both the node by 10 GB.

Thanks.
Mohammad Sanaullah
Alive
Avinash20
Honored Contributor

Re: Adding SWAP space on system

Hi,

If you are creating a LV on this VG, then please post the error message here.

Also if its in cluster, advice you to create the swap on internal disk (eg: vg00) on both the nodes
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Mohammad Sanaullah
Frequent Advisor

Re: Adding SWAP space on system

Avinash
While I am proceeding to create LV for swap on VG00 i have no error, but when we decided not to create swap on VG00 due to space constraint, which is 11 GB and we may use this in future for patching etc. So i tried to create on VG02 where we have 88 GB free space, and in other node in VG08 having 25 GB space.
The error comes to make this VG02 undistributed first.

If I will do VG02 to undistributed one, what impact will be there with running system, should I ask for downtime for the same.
Alive
Avinash20
Honored Contributor

Re: Adding SWAP space on system

Creating swap on Cluster Volume Group is not Advised, since if the package goes down, the vg might not get deactivated due to swap being used.

and hence the package cannot be halted.

Hence its is not advised.
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: Adding SWAP space on system

Also I believe that you are facing performance issue since 97% memory is being used.

I would recommend you to also check which processes are utilizing more physical memory and try to doing tuning for the same
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: Adding SWAP space on system

Advice:

1. Tune the application for reducing the load which will allow us to get more physical memory or Increase more physical memory

2. Increase the swap to increase the reserve space

If in case 11 GB of swap is not enough, advice to have a new HDD added to vg00
"Light travels faster than sound. That's why some people appear bright until you hear them speak."