cancel
Showing results for 
Search instead for 
Did you mean: 

swapmem_on

SOLVED
Go to solution
himacs
Super Advisor

swapmem_on

Hi Admin,

My swapinfo shows below output.

TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 808 7384 10% 0 - 1 /dev/vg00/lvol2
dev 6144 814 5330 13% 0 - 1 /dev/vg00/lvswap
dev 2048 696 1352 34% 0 - 1 /dev/vg00/lvol13
reserve - 8756 -8756
total 16384 11074 5310 68% - 0 -

Please note that memory field details is not present.I heard we need to enable swapmem_on parameter for the same.

What are the advantages by enabling swapmem_on?

regards
himacs

15 REPLIES
R.K. #
Honored Contributor

Re: swapmem_on

Hi Himacs,

In swapinfo -tam:
memory line:
+ indicative of how much of pseudo-swap has been reserved
+ when present, indicates pseudo-swap is enabled (i.e. swapmem_on kernel paraemter is set to 1, which is the default. The size of pseudoswap is calculated to be 75% of the size of RAM (a.k.a. memory.) In other words, it does not refer to acual physical memory use!!!! Pseudo-swap was designed specifically for large memory systems for which actual swapping is never (or rarely) expected to occur, so thereâ s less need to use actual physical disk space for swap.

For more information, see swapmem_on(5) , which reads:
In previous versions of HP-UX, system configuration required sufficient physical swap space for the maximum possible number of processes on the system. This is because HP-UX reserves swap space for a process when it is created, to ensure that a running process never needs to be killed due to insufficient swap. This was difficult, however, for systems needing gigabytes of swap space with gigabytes of physical memory, and those with workloads where the entire load would always be in core. This tunable was created to allow system swap space to be less than core memory. To accomplish this, a portion of physical memory is set aside as 'pseudo-swap' space. While actual swap space is still available, processes still reserve all the swap they will need at fork or execute time from the physical device or file system swap. Once this swap is completely used, new processes do not reserve swap, and each page which would have been swapped to the physical device or file system is instead locked in memory and counted as part of the pseudo-swap space.
Don't fix what ain't broke
Dennis Handly
Acclaimed Contributor

Re: swapmem_on

>What are the advantages by enabling swapmem_on?

On 11.31, this tunable was removed because it is always a good thing. What OS version to you have?
Kapil Jha
Honored Contributor

Re: swapmem_on

In simple terms it enables you to start more programs with less swap memory.

eg. If you have 4 GB of swap you would be able to start 4GB of programs (as you have to reserve space in swap to start a program), but ur swap is never fully used so it kindda waste of space.

With swapmem_on you would be able to start 4G of program with only 1G of swap(approx 75% of 4G)
reason being system rarely swap the whole program at a time.

BR,
Kapil+

I am in this small bowl, I wane see the real world......
Raj D.
Honored Contributor
Solution

Re: swapmem_on

himacs,

pseudo swap: System memory used for swap space that allows users to execute processes in memory without allocating
physical swap. Pseudo-swap is controlled by the operating system parameter swapmem_on which by default set to 1. that means enabled.


What is the os version you have: ,

For 11.31 the tunable swapmem_on has been obsoleted. Pseudo-swap will always be enabled, as was the default for previous releases of HP-UX.


For details Check out: [ Pseudo-Swap Space ]
http://docs.hp.com/en/1218/mem_mgt.html



Hth,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
himacs
Super Advisor

Re: swapmem_on

Hi Admins,

Thanx for the responses.

My server version is 11.23

my server memory usage is high most of the time.So by enabling swapon_mem i can reduce the high usage..


Regards
himacs
Dennis Handly
Acclaimed Contributor

Re: swapmem_on

>my server memory usage is high most of the time. So by enabling swapon_mem I can reduce the high usage?

I doubt it will make a difference.
Are you running into out of swap space error? Your swapinfo total was only 68%.
Is your buffer cache parms configured too high?
himacs
Super Advisor

Re: swapmem_on

Hi Denis,

Most of the time my total memory usage is above 85% and recently we have upgraded the memory.
and whats buffer cache parms..

If Enbaling swapon_mem does not resolve issue,what are the possibilities we can consider?

regards
himacs
Raj D.
Honored Contributor

Re: swapmem_on

himacs,

>>my server memory usage is high most of the time.So by enabling swapon_mem i can reduce the high usage..

Is it swap or physical memory you are refering as high. ?

- What is the current value of swapmem_on :
# kctune | grep -i swapmem

- swapmem_on when enabled it use physical memory to serve processes insted of allocating from swap memory. As mentioned earlier. If you are running out of physical memory , you have to add physical memory.
- Also swap space usage looks quite high.
- What is the ratio of physical memory vs swap memory configured in your system.
- You may add more device swap and see if the swap usage comes down. Then performance will improve little bit.

- Check paging activity with :
# vmstat -3 -5
( look at the pi/po value , a non zero value represents paging activity that is not good, do you see heavy paging..)


Hth,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor

Re: swapmem_on

himacs,

>memory usage is above 85% and recently we have upgraded the memory.

- Have you added the extra swap space accordingly after adding the memory. Swap can be 150 or 200% of physical memory.


Hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
himacs
Super Advisor

Re: swapmem_on

Hi Raj,

Thanx for the response.

Server memory is 12 GB

Total swap memory is 16 GB

swapinfo -atm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 550 7642 7% 0 - 1 /dev/vg00/lvol2
dev 6144 550 5594 9% 0 - 1 /dev/vg00/lvswap
dev 2048 442 1606 22% 0 - 1 /dev/vg00/lvol13
reserve - 10187 -10187
total 16384 11729 4655 72% - 0 -

swapmem_on is not enable

kctune |grep swapmem_on
swapmem_on 0 0

I will provide u vmstat putput once business hours starts.

Please suggest on this


regards
himacs
Raj D.
Honored Contributor

Re: swapmem_on

himacs,

Hmm..!
>Total swap memory is 16 GB


16GB (swap memory) is not enough for 12GB physical memory . Thats why you are seeing more swap usage .


- You should have 18 GB swap space, 20-24GB would be better .
- Try to add a 4 to 8 GB LV and configure as swap space. So that it will balance the swap space with physical memory.
- This can be done online if you have space on the vg00 or any other vg that can be allocated for swap space.


Hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor

Re: swapmem_on

> swapmem_on is not enable

If you enable swapmem_on, you will have pseudo swap enabled and it will allocate physical memory for processes and will not allocate more swap memory, so result you may see release of little bit of swap memory.

Btw, it looks like you need to add some swap space, at least 2-4GB.

Hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Dennis Handly
Acclaimed Contributor

Re: swapmem_on

>Server memory is 12 GB
>Total swap memory is 16 GB

By enabling swapmem_on, you will increase your total swap to ~ 25 Gb.

>what's buffer cache parms?

dbc_min_pct, dbc_max_pct
kctune | grep dbc_

>If enabling swapmem_on does not resolve issue, what are the possibilities we can consider?

More memory, more swap, reduce buffer cache or reduce piggy applications.
What is your real problem?
A total memory usage of 100% is usually a good thing.

>Raj: What is the current value of swapmem_on?

Why are you asking this? You must trust in the swapinfo(1m).
Raj D.
Honored Contributor

Re: swapmem_on

Dennis, correct.. , memory line is not there , swapinfo has the required info. thanks! .





" If u think u can , If u think u cannot , - You are always Right . "
Venkatesh BL
Honored Contributor

Re: swapmem_on

If things don't improve even after enabling swapmem_on, you have two options:
1) Add more RAM space (recommended)
2) Add more swap space.