1832857 Members
3057 Online
110048 Solutions
New Discussion

Re: swap trouble

 
David Lockwood
Advisor

swap trouble

I have a user who requires an additional 6Gb swap on a J6700 running HP-UX 11.11.

The user does CFD analysis and required an extra 6Gb of memory so, as a rule of thumb, I want to add an extra 6Gb of swap. This swap has to be added as file system swap (yuk, yes I know it is not efficient but the alternative is to copy 20Gb's of data off the disk, add device swap and reinstate the 20Gb's of data. The user does not have enough time for this to be done at the moment but will allow it in the long term). So ....

I started SAM, went to Disks and File Systems -> Swap, click on Actions and Add File System Swap, I select the filesystem and set the Minimum and Maximum Swap Mbytes to 6144 (6Gb). All goes well and I am told that the paging area has been created. However ....

When I look at swapinfo -tam I see that only 2048 Mb are available as swap on localfs. Where is my other 4096 Mb's?

The filesystem I selected had 12 Gb's of free space, swchunk is set to 2048 and maxswapchunks is set to 16384.
9 REPLIES 9
Stefan Farrelly
Honored Contributor

Re: swap trouble

I would say its maxswapchunks. Once you get swap areas >4Gb you need to increase from 2048 to 4096 minimum, probably 8192 to be safe. Youre going to have to reboot to change the kernel.
Im from Palmerston North, New Zealand, but somehow ended up in London...
A. Clay Stephenson
Acclaimed Contributor

Re: swap trouble

I agree that maxswapchunks is almost certainly your culprit. This is almost certainly a perfectly valid use of filesystem swap and especially if the swap isn't really used. If you do usae filesystem swap make certain that you set its priority lower (higher value) than any other swap so that it will be used last. You could probably do away with the additional swap and enable pseudoswap (swapmem_on=1); it's not really swap at all just kernel bookkeeping to allow larger virtual memory. Any box doing CFD (Fluent, maybe??) doesn't want/need to swap at all.
If it ain't broke, I can fix that.
Todd McDaniel_1
Honored Contributor

Re: swap trouble

I must say I am very puzzled why you would add 6GB of memory and then add 6GB of swap?

Im not sure what rule of thumb you are referring to, but the current HPUX rule of thumb is to have roughly 20-33% of swap versus memory.

My 48-way Superdome has 72GB of memory and about 36GB of swap... some of my other boxes have only 20% swap per memory.

I only have 27GB memory and 5GB of SWAP on one N-class of mine.

To view paging activity you need to go to glance if you have it and type "w" this will show you swap utilization on your box.

You can use commandline to read the amount of swap you use on intervals in seconds.

To monitor and print swap utilization once every two hours, specifying
a file, enter:

glance -j 7200 -f filename -w

You can shorten the seconds as you wish...

your system should only page out to free up memory when usage is high. Your system should almost never swap IN from swap
Unix, the other white meat.
T G Manikandan
Honored Contributor

Re: swap trouble

Add swap only if your machine is in need for swap i.e when the memory is highly utilized.

If you have added 6GB memory,check the usage of memory.If the memory is not highly used you can enable the swapmem_on on the system.

There is no rule as such.
yes,if the memory is completely utilized add swap.

The problem should be with the maxswapchunks.

Is your kernel newly built with a greater value of maxswapchunks
Steven E. Protter
Exalted Contributor

Re: swap trouble

Just as a general rule, pushing swap up past twice RAM is probably not a good idea.

It will slow your box down.

How much additional swap you need for this special request is dependent on what the system looked like before this application.

I'll endorse the prior posts, not that its necessary, but I've used advice Stefan and A. Clay gave on this subject to others to resolve issues myself. Hope that makes you feel better.

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
David Lockwood
Advisor

Re: swap trouble

maxswapchunks is already set to 16384

I have switched swapmem_on on in the kernel, the user will see how he gets on with that.

Thanks for all the help.
Todd McDaniel_1
Honored Contributor

Re: swap trouble

David,

Your situation still intrigues me. I have a few questions and an observation.

How much memory and swap do you have at present? Seems your user's tool is abit of a memory/swap hog... What is the current CPU load on your box? What type of box is it?

Was your box only configured for a certain level of activity and this tool pushed it beyond its normal capacity? So you need to add more memory?


--------------------------------------------
Also, I was just noticing your maxswapchunks is near what I have on my 48-way Superdome with 72GB memory and 36GB Swap...

My maxswapchunks is currently 13481, lower than what you have configured...of course it is hard to know how it compares to your box since I dont know what H/W you are running.
Unix, the other white meat.
Bill Hassell
Honored Contributor

Re: swap trouble

Turning swapmem_on just gave your user almost 4.5Gb of additional virtual memory. What swapmem_on does is to reduce the requirement that you must at least as much swap space as RAM or processes cannot access all of your RAM. Since that is the default value, most admins assume that 6Gb of swap plus 6Gb of RAM means about 10.5Gb of virtual memory. With swapmem_on=0, your 6Gb of swap is useless (will almost never be used) for large programs. To actually use more than 6Gb of virtual memory, you have to add swap on top of the useless 6Gb. The first 6Gb will be marked reserved and occasionally, memory mapped files may use some swap, but swapmem_on=1 will give you 75% of RAM plus all of swap together for a virtual memory map.


Bill Hassell, sysadmin
Sridhar Bhaskarla
Honored Contributor

Re: swap trouble

Hi,

Your particular situation is interesting. What is the utilization on your filesystem now?

bdf /filesystem

You should see a directory created as paging underneath this filesystem files created with each of size equal to your swchunk. What is the value of 'du -sk /filesystem/paging'?

Do you see any errors in your 'dmesg' output?.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try