Operating System - HP-UX
1823178 Members
3715 Online
109647 Solutions
New Discussion юеВ

Re: How to add additional Swap space!

 
leyearn
Regular Advisor

How to add additional Swap space!

Now on my system Physical Memory is 8GB
the swap space is 4GB
I added a new disk,how can I add the addition on this disk?
7 REPLIES 7
Adisuria Wangsadinata_1
Honored Contributor

Re: How to add additional Swap space!

Hi,

Check the url below (docID : KBRC00008533) about 'Increase swap size - Create a secondary swap' :

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000080021750

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
Rajeev  Shukla
Honored Contributor

Re: How to add additional Swap space!

You can not extend the existing swap but what you could do is add an additions device swap of say 4GB
Create a new VG (using vgcreate)or add this disk to an existing VG say VG00 (using vgextend)
Then create a LV of 4GB with Allocation = strict/contiguous
use lvcreate options -s strict -C contiguous

Now add the entry in fstab to get this swap space assigned at the boot time
/dev// ... swap pri=2 0 0
And then use swapon -a

DCE
Honored Contributor

Re: How to add additional Swap space!

You can easily add swap via SAM. The other thing you can do is activate pseudoswap in the kernel (swapmem_on=1)

This allow you to fool the system into thinking there is more swap than there actually is.

reasons for pseudoswap
1. save disks for data
2. swap beyond 4gb is rarely used - disk space is wated
3. If you are actually using 8 GB of swap (as opposed to rederving it) you system is going to be so slow that it is effectively off line.
leyearn
Regular Advisor

Re: How to add additional Swap space!

#lvcreate -n swap -L 8192 -C y /dev/vgswap
I edited the /etc/fstab file
and added the entry
/dev/vgswap/swap . default 0 0
[root@yjjf1]# swapon -a
Enabling device paging on /dev/vgswap/swap.
swapon: The kernel tunable parameter "maxswapchunks" needs to be increased to ad
paging on device /dev/vgswap/swap.

now the parameter : maxswapchunks is 2048
what is the number for the maxswapchunks when
the swap space is 4+8=12GB

thanks

Adisuria Wangsadinata_1
Honored Contributor

Re: How to add additional Swap space!

Hi,

Check the url below about maxswapchunks :

http://docs.hp.com/en/939/KCParms/KCparam.MaxSwapChunks.html

And here is the formula :

======================================
Total swap space is defined by:

swchunk * maxswapchunks * DEV_BSIZE

where DEV_BSIZE is 1024 bytes.
======================================

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
leyearn
Regular Advisor

Re: How to add additional Swap space!

yes I need to increase the parameter:maxswapchunks to 6144
I want to tune the parameter:dbc_max_pct
each need to reboot the system
can I tune the two parateters at the same time?
Adisuria Wangsadinata_1
Honored Contributor

Re: How to add additional Swap space!

Hi,

Yes, you can tune the parameter at the same time. But the good practice is always do one at the time, since need to make sure the system can run without any problem with the new kernel parameter and this will easy for us to troubleshoot.

And dont forget to have a good backup before change anything.

Cheers,
AW
now working, next not working ... that's unix