Operating System - HP-UX
1753774 Members
6561 Online
108799 Solutions
New Discussion юеВ

Re: Guys can somebody explain me about the psedo swap

 
pa8700
Regular Advisor

Guys can somebody explain me about the psedo swap

Guys can somebody explain me about the psedo swap.I seen that it is obsolute in 11.31.So how it is doing in 11.31
8 REPLIES 8
Ganesan R
Honored Contributor

Re: Guys can somebody explain me about the psedo swap

Hi,

In simple term, consider this..

You are having 100GB of memory in high end server. Theoritically you need minimum 100GB of swap space. If the running applications never need swap then it is going to be waste of space.

With the help of pseudo-swap enable you can virtually consider 75% of memory as swap space along with device swap. This way you can save the disk space.
Best wishes,

Ganesh.
Ganesan R
Honored Contributor

Re: Guys can somebody explain me about the psedo swap

Hi,

It is explained clearly here..

http://docs.hp.com/en/5965-4641/ch01s09.html
Best wishes,

Ganesh.
Don Morris_1
Honored Contributor

Re: Guys can somebody explain me about the psedo swap

The "swapmem_on" tunable is obsolete in v3, because pseudo-swap is always enabled. pseudo-swap itself (as a concept or as an implementation) is not obsolete.

From the way you've phrased it ("So how it is doing"?), it sounds like you understand the memory swap accounting trick concept -- so I'll forbear repeating it yet again here. Otherwise, http://docs.hp.com/en/1218/mem_mgt.html still holds true as a summary [other than the tunable removals as mentioned] -- and that v3 configures pseudo-swap to 90% of reservable memory [usually about 95% of RAM given to the OS] instead of 7/8ths.
Ramesh S
Esteemed Contributor

Re: Guys can somebody explain me about the psedo swap

It is not actually swap at all. It is a technique to tell the kernel to allow 75% of physical memory to count as process reservation space.

Consider a box with 16GiB of RAM and 4GiB of device or filesystem swap with pseudoswap disabled. The maximum amount of space for processes would be 4GiB regardless of the amount of free memory. Now if we turn on pseudoswap (swapmem_on=1), 0.75 x 16GiB = 12GiB is added to the reservation space and we can run 16GiB's of processes. Pseudoswap is intended for those systems which have much more memory than swapspace (you bought all that memory so that you would not swap!) and serves no purpose in systems where swap >= RAM (it should be disabled in those cases).

Important concept for UNIX: The amount of PHYSICAL memory does not limit the number and size of processes which can be run; the amount of VIRTUAL memory does. The amount of available physical memory does dramitically alter the speed at which those processes can run.

It is enabled by kernel parameter 'swapmem_on'

-Ram
Dennis Handly
Acclaimed Contributor

Re: Guys can somebody explain me about the psedo swap

>Ram: It is enabled by kernel parameter swapmem_on

Except on 11.31, where it only comes in the color black. ;-)
Taifur
Respected Contributor

Re: Guys can somebody explain me about the psedo swap

Hi Pa8700


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.


Rgds//
Taifur
Hakki Aydin Ucar
Honored Contributor

Re: Guys can somebody explain me about the psedo swap

About pseudo-swap:(quotation from HP Support pages)

A process reserves swap simply by decrementing these two counters. The
kernel doesn't actually use disk blocks until they are needed. Device swap is
used first, until swapspc_cnt=0 . When a process actually has to
allocate swap the system knows it has enough room to do so as it has been
allocated at the time of the fork call.
-
If there is no device or file system swap available , the system allocates
pseudo-swap as a last resort. It decrements swapspc_cnt and keeps
track of regions using pseudo-swap via a pswaplist. Pseudo-swap is
either free or pseudo-allocated , it is never reserved.
---
If pseudo-swap is disabled by setting swapmem_on to 0, there will typically be
a need to increase the amount of device swap in the system to accommodate
paging and reserve area. Ideally, in a modern system paging to disk should be
avoided. If there is significant paging to disk and the buffer cache has been
adjusted to avoid contention , adding RAM would be advisable for maximum
Suraj K Sankari
Honored Contributor

Re: Guys can somebody explain me about the psedo swap

Pseudo-Swap Space


System memory used for swap space is called pseudo-swap space. It allows users to execute processes in memory without allocating physical swap. Pseudo-swap is controlled by an operating-system parameter; by default, swapmem_on is set to 1, enabling pseudo-swap.

Typically, when the system executes a process, swap space is reserved for the entire process, in case it must be paged out. According to this model, to run one gigabyte of processes, the system would have to have one gigabyte of configured swap space. Although this protects the system from running out of swap space, disk space reserved for swap is under-utilized if minimal or no swapping occurs.

To avoid such waste of resources, HP-UX is configured to access up to three-quarters of system memory capacity as pseudo-swap. This means that system memory serves two functions: as process-execution space and as swap space. By using pseudo-swap space, a one-gigabyte memory system with one-gigabyte of swap can run up to 1.75 GB of processes. As before, if a process attempts to grow or be created beyond this extended threshold, it will fail.

When using pseudo swap for swap, the pages are locked; as the amount of pseudo-swap increases, the amount of lockable memory decreases.

For factory-floor systems (such as controllers), which perform best when the entire application is resident in memory, pseudo-swap space can be used to enhance performance: you can either lock the application in memory or make sure the total number of processes created does not exceed three-quarters of system memory.

Pseudo-swap space is set to a maximum of three-quarters of system memory because the system can begin paging once three-quarters of system available memory has been used. The unused quarter of memory allows a buffer between the system and the swapper to give the system computational flexibility.

When the number of processes created approaches capacity, the system might exhibit thrashing and a decrease in system response time. If necessary, you can disable pseudo-swap space by setting the tunable parameter swapmem_on in /usr/conf/master.d/core-hpux to zero.

At the head of a doubly linked list of regions that have pseudo-swap allocated is a null terminated list called pswaplist.