Operating System - HP-UX
1833873 Members
1856 Online
110063 Solutions
New Discussion

pseudo swap enable/disable

 
SOLVED
Go to solution
sudheer_7
Advisor

pseudo swap enable/disable

Hi,

We have an RP8400 SAP server running 11i with 12 CPUs and 24GB of RAM. We have been facing memory constraints with this system.

After going through HP-UX Performance cook book, man pages, other manuals on kernel tuning etc, we decided to set pseudoswap disabled. swapmem_on to 0. We have 32GB of device swap enabled for this device and we thought pseudo swap is not required. After this there were some of the process failing with an error-insufficient swap space, fork failed. We had to revert the change and system is back to old state now, with memory constraints.

Why and how can this happen please?

Swapinfo -tam output and some of the related parameters are attached. I admit dbc_min and max requires further tuning. How much can be a good value?

swapinfo o/p shows in PCT used column, dev is 0% used, but the total value is 100%. Is there anyhing wrong with this o/p?

Thanks in advance,

Sudheer
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: pseudo swap enable/disable

Shalom,

Swap settings require a reboot to take effect.

I also think you may be setting too much swap for this large memory system.

This document may be helpful.

http://www1.itrc.hp.com/service/cki/search.do?searchString=UPERFKBAN00000726&docType=Security&docType=Patch&docType=EngineerNotes&docType=BugReports&docType=Hardware&docType=ReferenceMaterials&docType=ThirdParty&hpweb_printable=true&searchCrit=allwords&search.x=28&admit=-682735245+1157990496963+28353475&mode=id&category=c0&search.y=8

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
sudheer_7
Advisor

Re: pseudo swap enable/disable

SEP,

Thanks for your reply. The system has been rebooted with the swapmem_on set to 0 as well as 1.

I have seen your earlier notes also on similar subjects, but could not get any clue on my current problem. I am also unable to open the document thread you have copied.

My concerns are pseudo swap should take effect only once the device swap utilization is over. Why disabling pseudo swap lead me to problems? And also why there is a descrepency in the swapinfo output?

Sudheer
Jaime Bolanos Rojas.
Honored Contributor

Re: pseudo swap enable/disable

Sudheer!

In the swapinfo -tam that you sent, I can see that in that specific case you disable pseudo-swap becuase your memory line is missing in the output.
I also notice that even though your system is not swapping, you have reached the %100 reserved swap ( This is very important becuase once you reached that level you are going to start getting fork failed error messages ).

Once thing to think about maybe is what is consuming all your memory. Other thing please re-enable your pseudo_swap.

Take a look at this doc to analyse memory issues on your machine:

ftp://eh:spear9@hprc.external.hp.com/memory.htm

Regards,

Jaime
Work hard when the need comes out.
A. Clay Stephenson
Acclaimed Contributor

Re: pseudo swap enable/disable

You are right at the cusp of actually swapping --- although you might think that you should be showing about 12GiB of swap actually in use.

Let me see if I can give you an example that will mimic your situation. Suppose that I have a process that does a malloc() of a 4GiB chunk of memory. That will immediately increase the reserved chunk of memory but because the process hasn't actually accessed the memory yet the USED value does not change. Some of your processes have apparently done something very similar (ie allocated memory but haven't actually used (accessed) it yet. It's rather common for some applications to allocate very large chunks of memory but initially actually access only very small portions of it. In any event, the answer is to add more swap swapspace. In your case, swapmem_on=1 will only appear to fix things and only temporarily. Now the real answer (because almost certainly the memory is going to be used) is to add more physical memory and more swap space. If you can find some way to better tune the applications to use less memory that is also an option. Playing with the the buffer cache is only going to change things by 0.5GiB or so and that is too small to really affect your situation much. You really need to add about another 12GiB of memory and still a bit more would be nice. In your case (and especially if you are able to install more memory), I would disable dynamic buffer cache and set it to a static size of about 1GiB or so by setting bufpages to a non-zero value.
If it ain't broke, I can fix that.
john korterman
Honored Contributor

Re: pseudo swap enable/disable

Hi Sudheer,

has your dba required that the value for shm_max be set to two thirds of the physical memory?
If not, go and ask him what the database requires/recommends, as this is quite important.


regards,
John K.
it would be nice if you always got a second chance
Bill Hassell
Honored Contributor

Re: pseudo swap enable/disable

The parameter is swapmem_on and since it dramatically affects how memory is assigned, changing it from 1 to 0 will require a reboot. Now your dbc_max_pct is 8 which means that about 1600 megs is used for the buffer cache. You might reduce it to 6 but it will not halp your memory problems. Almost *every* error message about insufficient swap or lack of memory is from an old 32bit program that is constrained by maxdsiz and shared memory fragmentation.

Managing 32bit programs when they require large amounts of memory requires a lot of knowledge about 32bit program limits. With 24 Gb of RAM, you do not any problems with physical memory -- all your problems are with the severe limitations of 32 bit programs. By default, you are limited to a maximum of about 960 megs local memory. By changing compile options to EXEC_MAGIC, you can get up to 1750 megs of local memory, and with chatr options +q3p and +q4p, your program may be able to get as much as 3700 megs of RAM. These documents will help explain the issues:

32 bit programs
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062686726
http://www1.itrc.hp.com/service/cki/docDisplay.do?doc%3CBR%3ELocale=en_US&docId=200000009254450

Shared memory
http://docs.hp.com/en/943/memwn1_4.pdf

memory windows
http://docs.hp.com/en/943/memwn1_4.pdf

Note that the current value of ulimit in your shell or the startup environment for your programs will affect large programs too.


Bill Hassell, sysadmin
sudheer_7
Advisor

Re: pseudo swap enable/disable

Hi,

Thanks for all the replies.

Again what I do not understand is why disabling pseudo swap, caused failure of some of the processes .?
Jaime Bolanos Rojas.
Honored Contributor
Solution

Re: pseudo swap enable/disable

Sudheer,

The thing is this, if you do not have pseudo-swap enable, then the only thing that you got left is file swap and device swap.
If you reserved ( not used but reserved ) the 100 % of swap in your system, the no new processes are going to start, becuase for every new process that start a bit of swap space have to be reserved.

Pseudo-swap is not physical swap space backed up by disk and it's not memory either, it's like an imitation of it. Once the system reserved all your swap areas, the kernel will look for pseudo-swap to go beyond that limitation. That is why you started getting fork failed errors becuase you disabled pseudo-swap.

Regards,

Jaime.
Work hard when the need comes out.
sudheer_7
Advisor

Re: pseudo swap enable/disable

Thank you Jaime..

I am closing thread with that...