Operating System - HP-UX
1834170 Members
2955 Online
110064 Solutions
New Discussion

Kernel Params Pseudo Swap?!

 
SOLVED
Go to solution
Charles Harris
Super Advisor

Kernel Params Pseudo Swap?!

Dear all,

An external application support company has recommended turning off 'pseudo swap' on one of our servers, as they claim it is taking valuable resources, yet not being utilised. Which seems fine.
My question, I understand the theory of swap but what the h*ll is pseudo swap all about? virtual virtual memory??

Any pointers, explanations, links warmly received!!

Cheers,

-ChaZ-
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor
Solution

Re: Kernel Params Pseudo Swap?!

Hi Charles:

Knowledge Base document #KBRC00001129 explains this the best I have heard:

/begin_quote/

Pseudo swap is HP's solution for large memory customers who do not wish to purchase a large amount of swap space. The justification for purchasing large memory systems is to prevent paging and swapping, therefore, the argument
becomes "Why purchase a lot of swap space if the system is not expected to page or swap?"

Pseudo swap is swap space which the operating systems recognizes, but in reality it does not exist. Pseudo swap is make-believe swap space. It does not exist in memory, it does not exist on disk, it does not exist anywhere. However, the operating system does recognize it, which means more swap space can be reserved than physically exists.

The purpose of pseudo swap is to allow more processes to run in memory, than could be supported by the swap device(s). Swap devices refer to both device swap or filesystem swap. It allows the operating system(specifically the kernel variable swap_avail) to recognize more swap space, thereby allowing additional
processes to start when all of the physical swap has been reserved.

By having the operating system recognize more swap space than physically exists, large memory customers can now operate without having to purchase large amounts of swap space which they will most likely never use.

The size of pseudo swap is dependent on the amount of memory in the system. Specifically, the size is 75% of physical memory. This means the swap_avail variable will have an additional amount (75% of physical memory) added to its content. This additional amount allows more processes to start when all of the
physical swap has been reserved.

Pseudo swap is enabled through the tunable kernel parameter called swapmem_on. If the value for swapmem_on is 1, then psuedo swap is turned on or enabled. The percentage of physical memory that pseudo swap adds to swap_avail is not a tunable kernel parameter and is always 75%. This information is valid for all versions of HP-UX 10.X and 11.0.

/end_quote/

Regards!

...JRF...
Roger Baptiste
Honored Contributor

Re: Kernel Params Pseudo Swap?!


Regular swap exists on Disk, as per the
way it is configured. For eg, /dev/vg00/lvol2
by default is primary swap and is part
of the VG00 disks. Similarly you can
add more deviceswaps (or filesystem swaps)
in addition to the primary swap. But, the
point is, all of them exist on Disk.

Whereas, Pseudo swap exists in Memory.
When pseudo-swap is enabled through a
setting in the kernel configuration parameter
called pseudo_swap, it makes the system
use 75% of memory for swapping purpose,
as on demand. The advantage of this is,
you get a faster swap area, since it is
within memory. Another advantage is
on High-memory systems, where much
of the memory may lie unused, pseudo-swap
is a way to make the best use of it.
The flip side is , it lessens the availability
of memory to be used for "memory"!.

With this background, enabling or disabling
pseudoswap depends on the system- the
applications running on it, how much
load is on the memory, how much of swapping
is being done etc.

To check your current Swap usage: do
swapinfo -mt
-> and look for the row corresponding
to memory. Also look at overall
swap usage

If there is a heavy load on memory, then
you may be better of disabling the pseudo-swap. At the same time, make sure you
add device swap (lvcreate ..; swapon )to
make up for the pseudo-swap loss.

Have a look at glance and see how the
memory usage is. Monitor it for a few
days, before making a decision.
Also have a look at the VHAND and
SWAPPER processes amd see how active they
are. If VHAND is very active, then it
means there is a load on memory.

If you have more questions, pls post
the physical memory of your system and
the swapinfo -mt output.

HTH
raj
Take it easy.
James R. Ferguson
Acclaimed Contributor

Re: Kernel Params Pseudo Swap?!

Hi (again) Charles:

ALSO, see this link.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x9e7487dc4d7dd5118ff00090279cd0f9,00.html

Follow the discussion and note particularly Carsten Krege's comments. He unearthed some very interesting information regarding performance when pseudo-swap is enabled.

Regards!

...JRF...
Charles Harris
Super Advisor

Re: Kernel Params Pseudo Swap?!

Once again, I astounded by the great advice / links fellow members share with this forum!!! - Exactly what I was looking for !!

Thanks!

-ChaZ-
Frank Slootweg
Honored Contributor

Re: Kernel Params Pseudo Swap?!

Just to keep the facts straight, I have to contradict RajMan's "The flip side is , it lessens the availability of memory to be used for "memory"!." comment and other similar comments. swapmen_on set to 1 does NOT have an impact on the availability/use of memory. Quite the contrary, with swapmem_on set to 0, the system will be unable to use available memory if the disk swap space is too small.

As James' pointer indicates, see Carsten Krege's comments in the referenced thread, especially his "Pseudo swap has no negative performance impact." and "For the vast majority of systems it makes sense to enable pseudo swap." comments.

To be complete: There *is* a possible performance impact, but that is normally *not* applicable to the majority of applications, i.e. the 'business' ones. This performance impact is *only* applicable to highly *compute bound* processes, i.e. *not* your typical business application (my/HP reference ).

So bottom line:

Unless you have compute bound performance problems, swapmem_on should be set to 1.
Charles Harris
Super Advisor

Re: Kernel Params Pseudo Swap?!

Thanks for the additional explanation, the almost text book definition was what I am really interested in, although I must admit, I'm not tempted to turn off the pseudo swap as the server in question has 6 gig of memory, which would prove a little excessive ( especially in cost per MB ) in EMC disk space ( mirrored 4 ways!!!! )

Thanks again!


-ChaZ-
Roger Baptiste
Honored Contributor

Re: Kernel Params Pseudo Swap?!

<>


My observation was based on one instance,where on a 2Gb K Database server, i had to remove pseudo-swap, since the load on the
memory was constantly high causing memory
bottlenecks. The memory issue eased considerably after that.

But the thumb rule of having pseudo swap
enabled remains.

Also, in one of the threads James posted,
there was a reference to Primary swap
getting higher priority over Pseudoswap,
since it's priority is one. But, i have
noticed pseudo-swap getting used first.
(in swapinfo -mt output or glance-> systems
with pseudo swap have a xx usage against
them, whereas the primary swap has less or
no usage.).


Keeping the Swap-pot boiling ;-)
-raj
Take it easy.