Operating System - HP-UX
1753550 Members
5444 Online
108795 Solutions
New Discussion юеВ

Increase primary swap space

 
SOLVED
Go to solution
Herbert Loevenich
Frequent Advisor

Increase primary swap space

I'm increasing the RAM space in my HP-UX 11.00 system. I would like to increase the swap space accordingly. swap space = 2*RAM.

What is the process to increase the primary swap space?

Thanks for your help

50% of all problems are based on communication issues, lets talk
7 REPLIES 7
Robert-Jan Goossens
Honored Contributor

Re: Increase primary swap space

Hi,

If you like to add primary swap, you will need to create a bootable ignite backup and restore your OS with larger lvol's.

How large is your pri swap ? I use 2 GB pri swap on 1.5 physical mem. After that I add secondary swapspace.

Hope this helps,
Robert-Jan
RAC_1
Honored Contributor

Re: Increase primary swap space

The lvols 1, 2 and 3 have to be contigous.
(/stand, swap and /) So increasing it like reinstalling the server. But why to do that??

Create a seconday swap with required space.
lvcreate -L xxxM -C y -r n /dev/vgxx/lvolx

It would be better, if you create that on another disk than that of primary swap. i.e. if primary swap is on dev/dsk/c1t1d0, then it is good to create the swconday device swap on /dev/dsk/c2t2d0.

Also seconday swap can be anywhere, it could be in vg01 also. (just make sure that you activate the vg during boot up process)

Once you create that, put an entry in /etc/fstab

/dev/vgxx/lvolx ... swap pri=1 0 0
swapon -a (man 1M swapon to turn it on)

Later, tune the maxswapchunks parameter to reflect the added swap space and reboot.
Setting the same priority as that of primary device swap gives good performance.

Anil
There is no substitute to HARDWORK
Bharat Katkar
Honored Contributor
Solution

Re: Increase primary swap space

Hi,
If you are increasing RAM then it is not compulsary to increase the swap as well. Try monitoring the swap first then if necessary you can increase the swap if required. If you see more page faults then you can try increasing the SWAP. But since you increased memory probably it would fine as it is. You can use vmstat, sar to monitor swap. see man vmstat,sar.

Now still if you want to increase the primary swap then:

see man lvextend
see man swapon

Regards,
You need to know a lot to actually know how little you know
Herbert Loevenich
Frequent Advisor

Re: Increase primary swap space

thanks for the information so far.

The system looks at the moment
9 Gbyte (on one physical disk)
256 MByte RAM
512 MByte swap space

the memory will be increased
to 512 MByte RAM, due newer application software release.

# swapinfo returns
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 524288 89188 435100 17% 0 - 1 /dev/vg00/lvol2
reserve - 160548 -160548
memory 177748 55260 122488 31%

# sar -w 60 3
22:59:48 swpin/s bswin/s swpot/s bswot/s pswch/s
23:00:48 0.00 0.0 0.00 0.0 1445
23:01:48 0.00 0.0 0.00 0.0 1671
23:02:48 0.00 0.0 0.00 0.0 1658

Average 0.00 0.0 0.00 0.0 1591

Following your suggestions so far,
adding memory and monitoring the swap space usage.
50% of all problems are based on communication issues, lets talk
Sundar_7
Honored Contributor

Re: Increase primary swap space

Your system's doesnt seem to use swap much (only 17% used).

but still for a system with only 512 MB, it would be a good idea to increase the amount of swap space you have.

As mentioned above, you cannot increase primary swap without rebuilding the system using ignite-ux recovery tape

also it looks like you have the pseudo swap enabled (swapmem_on kernel parameter).

1) add a secondary swap
2) disable pseudo swap.
Learn What to do ,How to do and more importantly When to do ?
Sridhar Bhaskarla
Honored Contributor

Re: Increase primary swap space

Hi,

'swapinfo -t' will give you more information. "PCT USED" under the total column of your 'swapinfo -t' should be less than 100 always otherwise you will not be able to bring up more processes. From the partial numbers you provided, I see that around 45% swap is being used that includes 'paged out pages + reservation'.

I see that 90 MB is already sitting on the swap. It could be either memory mapped pages or the 'real paged out' pages. If the later is the case, then what you are doing is right - increase memory.

Since you already have pseudo_swap enabled, increasing memory is going to buy you little more swap needed for reservation and it will also cover your memory needs. So, I don't see any reason why you have to increase your device swap, not your primary swap at all. I would keep monitoring the box and see if the total swap utilization in 'swapinfo -t' reaches 90% and then consider adding 'secondary swap'.

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
Trond Haugen
Honored Contributor

Re: Increase primary swap space

The question here is why are you adding more memory?
If you are adding more memory because you are going to put more load on the system you may want to add more swap. But I would say it don't have to be primary.
If you are adding more memory in order to increase performance the point is to have enougn RAM so you don't need swap.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn