1825643 Members
3647 Online
109685 Solutions
New Discussion

swap space increase

 
james gould
Frequent Advisor

swap space increase

Have 8gb total memory installed on rp4440 server. Want to increase swap space to double
to 16gb. Here is the output from 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 4000 252 3748 6% 0 - 0 /dev/vg00/lvol9
reserve - 7844 -7844
memory 6305 4757 1548 75%
total 14401 12853 1548 89% - 0 -


Not sure best way to increase the swap on the root volume disk.
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: swap space increase

Hi James:

First, secondary swap doesn't have to be on vg00.

That said, do something like:

# lvcreate -C y -r n -L 8092 -n lvolX /dev/vgNN

# swapon -p 0 /dev/vgNN/lvolX

# echo "/dev/vgNN/lvolX ... swap pri=0 0 0" >> /etc/fstab

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: swap space increase

Shalom,

You don't want to increase swap to 16 GB.

8 GB is more than enough.

Check vmstat.

If you are really paging, you don't need more swap, you need more ram.

Large memory systems need not have twice ram as swap. 8-12 gb is sufficient.

If you still want to do it, the best way to go is device swap.

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
Sharma Sanjeev
Respected Contributor

Re: swap space increase

Hi James

You can use below steps to create additional Swap

Use the following procedure to add filesystem as a secondary swap

1. create a separate vg for it. After that you can do this to create your addl swap.

2. # lvcreate -L 4000 -n swap2 -C y -r n /dev/vg01
==> create 4000MB contigous lv called swap in vg01 with bad block reallocation turned off

3.# swapon -p 1 /dev/vg01/swap2
==> enable swap with priority 1.

4.# swapinfo -ta
==> check to see if added swap is enabled.

5. # vi /etc/fstab
....
/dev/vg01/swap2 ... swap pri=1 0 1

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE