Operating System - HP-UX
1849279 Members
6112 Online
104042 Solutions
New Discussion

Iincreasing 28 GB swap space ln lvm.

 
hp100001
Occasional Contributor

Iincreasing 28 GB swap space ln lvm.

What should be my new swchunk size and maxswchunk size?
My original swap is 4GB with 32 GB physical total memory.

I do the following and found the following problem:

# lvcreate -n swap -C y -r n p3swap
Logical volume "/dev/p3swap/swap" has been successfully created with
character device "/dev/p3swap/rswap".
Volume Group configuration for /dev/p3swap has been saved in /etc/lvmconf/p3swap.conf
#

# swapon -p 1 /dev/p3swap/swap
swapon: The kernel tunable parameter "swchunk" needs to be increased to add
paging on device /dev/p3swap/swap.

This is my swchuck value.
sysdef |grep -i maxswapchunks
maxswapchunks 0 - 1-16384 -
# sysdef |grep -i swchunk
swchunk 2048 - 2048-16384 kBytes -


6 REPLIES 6
DCE
Honored Contributor

Re: Iincreasing 28 GB swap space ln lvm.



This thread details the info on swchunk and maxchunksize.

Also make sure you have swapmem_on=1 for psuedoswap.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=372387
Senthil Kumar .A_1
Honored Contributor

Re: Iincreasing 28 GB swap space ln lvm.

Hi,

If you want to add 28GB of swap (Not advisable, see my P.S below), you do not require to change the swchunk (page szie), just increase "maxswapchunks". In newer version of HPUX it is not required to change, because Kernel will autotune as per its requirement. But any way with swchunk set to "2048" , your new value of "maxswapchunks" to accomodate 28GB would be 14336. set it to 20000, to accomodate the existing swap space aswell.

Regards,
Senthil Kumar .A

P.S:

Actually there is no reason you need to increase the swap space. In early implementations there was a thumb rule that swap be configured double the size of RAM. But then RAM size was small in the past. Now as your example suggests, the RAM in a system is drastically increased. This means that thumb rule is not valid anymore and simply we waste the space on the Harddisk for swap space, in anticipation of bigger process which is most unlikely. Hence we have another feature which is a option to fool the kernel to think its got enough swap for reservation for forking, this is called pseudo swap. This feature can be turned on by just setting the Kernel parameter "swapmem_on" to 1. By this try leveraging the swap in your system with proper analysis. Try configure "interleaved" Device swaps with lesser magnitude and turn on the pseudo swap feature and optimize by analysing with "swapinfo -tam" command with various loads and applications on your system. There by you do not require to waste 28GB of space for SWAP.
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
hp100001
Occasional Contributor

Re: Iincreasing 28 GB swap space ln lvm.

hi, Oracle recommend to increase swap space to 1.5 times the existing memory which is contradicted to what we discuss here. Please review the cut and paste and to see whether it make sense.

CAUSE DETERMINATION
=====================
All indications are they you either ran out of swap or ran out of space in /tmp.

CAUSE JUSTIFICATION
===================
Your server currently has 32 gb of physical memory and 32gb of swap space. The usual rule of thumb is to have swap configured for at least 2 t
imes the amount of physical memory. For larger memory systems such as this, it c
an sometimes be set at 1.5 times the amount of memory. We do not recommend runni
ng with swap configured for less than 1.5 times the amount of memory.

POTENTIAL SOLUTION(S)
=====================
Increase the amount of swap space

POTENTIAL SOLUTION JUSTIFICATION(S)
==================================
Your swap is only configured for one times the amount of physical memory. Minimum recommended swap
is 1.5 times physical memory.

SOLUTION / ACTION PLAN
======================
I believe the issue can be resolved by adding more swap space. Recommended minimum
for your system would be 48gb.

A. Clay Stephenson
Acclaimed Contributor

Re: Iincreasing 28 GB swap space ln lvm.

I would never let a vendor get away with an error message that couldn't distinguish between running out of space in /tmp (which they shouldn't be using anyway; the correct directory for at least a decade is /var/tmp) and running out of swap space. These are unrelated system calls and unrelated errno values. I would insist on speaking to one of the backline people and discuss this with him. They should be able to focus the problem much better than this. The suggestion that more swap is needed may be valid but if so you are going to pay a huge performance penalty. You should use swapinfo and vmstat (note the po (pageout) rate; it should be very near zero almost all the time. If swap is actually being used then if you can't add more memory, you should reduce the size of your SGA. The performance impact of significant swapping is at least 100X that of extra physical reads because the database cache is smaller.
If it ain't broke, I can fix that.
Senthil Kumar .A_1
Honored Contributor

Re: Iincreasing 28 GB swap space ln lvm.

Hi,

Quite surprised how Oracle can impose such a blind claim of Swap space. They should be aware that swap is not used immediately by any process unless there is a memory constraint. Intially the swap is used only for reservation, by this I mean, its just a number defining the reservation to keep the memory allocation checked while process forking. The pseudo swap in your sytem should be more than sufficient. If they insist upon there claim, please ask them the actual reason ,with respect to your sytem, They need to justify for such a addition of swap from system perspective. Mainly you are supposed to be confident from your end of the swap usage. For that please check the swap usage using "swapinfo", "vmstat" and glance. Once confident you will be well equipped to discuss the issue with them. I think, 48GB of swap space is preposterous by any means.

One more pointer, there claim seems to be very vague as far as there mixing up of, swap and /tmp is concerned. Its unrelated.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Steven E. Protter
Exalted Contributor

Re: Iincreasing 28 GB swap space ln lvm.

Shalom,

I would suggest increasing maxswapchunks to 16384 for such a massive swap file.

On this system, I'd reccommend only going to 16 GB total swap for a start. Your system will allocate swap for processes as they are spawned, but if it never uses swap for actual paging, you may be wasting disk space that can be put to better use elsewhere.

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