Operating System - HP-UX
1824206 Members
4242 Online
109669 Solutions
New Discussion юеВ

Help understand swapping in HPUX

 
Eric Herr
Advisor

Help understand swapping in HPUX

Recently moved from Solaris to HPUX on Itanium servers. I am getting many Oracle memory since moving these databases most of which relate to swap space. When I look at swap utilization in glance I see it at 98% utilized. When I do a swapinfo I see memory is at like 94% but device swap at 4% utilized. I added an additional 8G of device swap which dropped swap utilization in glace to 64% but when did another swapinfo I show the new device swap at 0% utilized. Can someone make sense of this?
5 REPLIES 5
Hai Nguyen_1
Honored Contributor

Re: Help understand swapping in HPUX

Eric,

Can you post your "swapinfo -tam"?

Hai
Sundar_7
Honored Contributor

Re: Help understand swapping in HPUX

Eric,

In HP-UX, by default, so called "psuedo swap" is enabled. That is why you see the memory utilization in swapinfo

This is controlled by the kernel paramer swapmem_on. By default this is 1. In most cases, this can be disabled. Set this to 0, rebuild the kernel and boot using the kernel. You will not see the memory line in the swapinfo output anymore.

Also in HP-Ux, the processes "reserve" swap space even though it may never be used (unless you enable lazy swap allocation for the binary). And HP-UX swap management will always allocate (or reserve) space from the swap device with lowest priority number. That is probably you see why the new device swap is never used.

The new device swap will only be used if the primary one is completely used.

To rectify, you will need to change the priorities for the swap devices in /etc/fstab and reboot.

Hope this helps.

Sundar.
Learn What to do ,How to do and more importantly When to do ?
Eric Herr
Advisor

Re: Help understand swapping in HPUX


SWAP FROM GLANCE:
Swap Util U UR R | 67% 67% 67

swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 12240 477 11763 4% 0 - 1 /dev/vg00/lvol2
dev 8712 0 8712 0% 0 - 0 /dev/vgswap/lvswap1
reserve - 12594 -12594
memory 11215 8438 2777 75%
total 32167 21509 10658 67% - 0 -
Sundar_7
Honored Contributor

Re: Help understand swapping in HPUX

As you can see the PRI (priority) is different for the swap devices (0 and 1). If you would like the swapping system to use both the devices in an overlapping manner, then set the PRI to the same.

But it is probably not a very good idea since both the swap devices are not of the same size.
Learn What to do ,How to do and more importantly When to do ?
Don Morris_1
Honored Contributor

Re: Help understand swapping in HPUX

Sundar's second paragraph is the most relevant.

Unices differ in how they handle low-memory conditions. HP-UX has chosen to deal with this by enforcing the rule that all virtual allocations must reserve the equivalent amount of swap space. As a result, any physical memory used to back the virtual object should always be movable to swap if the system decides to page it out. This shows in your swapinfo output on the "reserve" line -- and you'll note the reservation is larger than either of your device swap areas [hence you are using some of each as far as reservable swap resources / potential User Virtual Address space].

Memory/pseudo-swap is an accounting trick where the kernel allows physical memory to account for the swap reservation as well. The primary use of this is on systems with working sets that fit into physical memory so that they don't need large amounts of swap -- it is also used when memory is locked (and is unpagable). Since you mentioned Oracle which is a big lockable memory client -- I expect your memory line being 75% used reflects locked memory.

As always, the VM whitepaper has more detail on these issues:

http://docs.hp.com/en/1218/mem_mgt.html