Operating System - HP-UX
1756808 Members
3080 Online
108852 Solutions
New Discussion юеВ

Re: pseudo-swap calculating

 
SOLVED
Go to solution
Inesa Clinko
Advisor

pseudo-swap calculating

Dear all,
please explain me what happened with 1 of our mashine - Superdome. OS is 11.23.
We have oracle-DB on it.
Yesterday we had a problem with the forks of processes /because of the lack of swap/:
#swapinfo
TYPE AVAIL USED FREE USED PRI NAME
dev 16777216 0 16777216 /dev/vg00/lvol2
reserve -16777216 -16777216
memory 33488304 31040816 2447488 93%
total 50265520 47818032 2447488 95%

The mashine has Kernel parameters, related to memory and swap:
dbc_max_pct 5
dbc_min_pct 1
swapmem_on 1
unlockable_mem 20480

We added more swap devices and the problem was solved:
#swapinfo

TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 16777216 0 16777216 0% 0 - 1 /dev/vg00/lvol2
dev 16777216 0 16777216 0% 0 - 1 /dev/vg01/lvol1
dev 16777216 0 16777216 0% 0 - 1 /dev/vg01/lvol2
reserve - 41212296 -41212296
memory 50265520 26782684 23482836 53%

My question is:
"Why the problem occur,if we had pseudo-swap
option activated. Wether the system calculated
the amount of swap regarding to usage of memory at that moment? Is there any Kernel-parameter conflict with the pseudo-swap calculating? Could I resolve the problem without the creating 2 more swap-devices?





5 REPLIES 5
Jdamian
Respected Contributor
Solution

Re: pseudo-swap calculating

I cannot understand the change in memory line in the output of swapinfo command after adding swap: prior the column "AVAIL" in memory line shows 33488304, but in the second case that column shows 50265520 -- this value used to be near 75% of physical memory.

For me, your problem is very clear.

Your box had 16 GB as swap space but your physical memory (at least 32 GB - I think) is larger than swap space.

When a process needs memory, HP-UX allocs memory pages for it and reserves swap space (reserve line in swapinfo output increseases). As process in your box needed memory, HP-UX did this. But one 16 GB were reserved, HP-UX couldn't reserve any more swap space. As pseudo-swap is ON, HP-UX uses the remaining physical memory (near 16 GB in your case) as swap space and marks those memory pages as BLOCKED. This makes no other process may use these memory pages and increase the percentage in "memory" line of swapinfo command. This process of allocating swap space continued until this value reached near 100%, then fork problems appeared.

As you added new swap, BLOCKED memory pages were released and turned as "reserve" swap space (note reserve line increased a lot). Then percentage of "memory" line decreased.

As rule, define, at leat, so much swap space as physical memory had you box.
Inesa Clinko
Advisor

Re: pseudo-swap calculating

Thank you for your responce. But I have already thought that the parameter swap_on
initiating only calculation for the system, not really blocked the pages on memory.
Where can I read more about these BLOCKED pages in memory for pseudo-swap?
Jdamian
Respected Contributor

Re: pseudo-swap calculating

Maybe I wrote BLOCKED when I wanted to write LOCKED.

A process with proper privileges may lock pages in physical memory (read man pages of shmctl(2)). This means that they never will be swaped out to disk and will increase the percentage in "memory" line of swapinfo command. In the man pages of swapinfo command you can read:

.
Kb USED The current number of 1-Kbyte blocks used for paging in the paging area. For the memory paging area, this count also includes memory used for other purposes and thus unavailable for paging.
.

Read page 85 and others about Swap Space in attached PDF doc. This doc is titled "HP-UX Memory Management White Paper". I downloaded from http://docs.hp.com some time ago. In HP-UX 11.00, it also was located in /usr/shared/doc directory but I cannot find it in that location in HP-UX 11.11.

Read also "Locks" section in http://www.interex.org/pubcontent/enterprise/jan01/06summ.html

Read HP doc RCMEMKBAN00000027 titled "Understanding Shared Memory on PA-RISC Systems" found in ITRC docs.
Inesa Clinko
Advisor

Re: pseudo-swap calculating

Thanx :))
Peyman Javaheri
Frequent Advisor

Re: pseudo-swap calculating

Hi,

Great information from gurus here. I just wanted to add my novice two cents:

Your total memory = swap + physical

When you added swap your total memory increased. HP-UX unlike some other posix (like linux) operating systems counts total memory and not only physical. Thus, you simply needed more lockable memory than what you had.

swapmem_on will remove the requirement for swap, but does not add memeory for you.

regards,
peyman;