1834279 Members
1768 Online
110066 Solutions
New Discussion

Swap

 
SOLVED
Go to solution
Rumen Ginev
Frequent Advisor

Swap

On a K-class with HP-UX 10.20
I added second swap device with the same size and priority as the first one. I did this by:
lvcreate -C y -n lvswap /dev/vg01
swapon /dev/vg01/lvswap

It seems the system runs fine, but in the output from swapinfo -ta the field "USED" (for both swap devices) is allways "0".

Do I have problem? How to resolve it?
5 REPLIES 5
freddri
Advisor
Solution

Re: Swap

You most likely do not have a problem. Chances are a kernel parameter called swapmem_on is set to 1. This enables pseudo swap. A GREAT thing. Pseudo swap allows is the system to swap within memory up to 75% of your memory. When the memory becomes full then device swap is used. There is no potential for harm using psuedo swap. Your device swap will appear as 0% until the system needs to swap outside of memory. The concept reduces disk I/O which leads to better performance.
freddri
Advisor

Re: Swap

Chances are you have swapmem_on set to 1. This variable enables pseudo swap or swapping inside of memory. If the system needs to swap something out and some memory is available, it will be done inside of memory instead of to disk. Much better and faster, and there is no potential for harm. Once certain thresholds are met, device swap will be used by the OS.
Selvaraj
Advisor

Re: Swap

Yes I do believe that there is a possibility of kernel parameter swapmem_on value set to one.Set back that variable to 0 and try swapinfo command, there is possibility of getting solution for your question.
You can do it man !
freddri
Advisor

Re: Swap

I would have to disagree with setting the variable to 0. If you are swapping in memory that is a great thing. You are reducing disk io and are running much faster. When the system needs the memory it will stop using pseudo swap and use device swap. Do a swapinfo -ta and look at the memory line. Theat will give you an indication of how much pseudo swap you are using.
Jason Luginbuhl
Frequent Advisor

Re: Swap

Some perspective on the information that was given. Psuedo-swap is not really used before device swap. The problem that you are seeing is in the interpretation of what the "used" column is actually telling you. You will not see anything other than 0% in this column for the device swap areas unless you are actively swapping processes out to disk. This is a good thing (for performance) that you are seeing 0% for these device swap areas.

You will notice that you have significant amount of "reserved" space for these devices. "Reserved" means that as processes are started they "reserve" space in swap "just in case" they need to be swapped out. That is what this "reserve" column is showing in swapinfo. This is shown with a negative number to indicate that this amount of device swap is reserved and unavailable. This is indicative of how much device swap is being "used". However, if the process is never actually swapped out you will never see this "reflected" in "used".

As mentioned before, pseduo swap will be show as a memory line in swapinfo. This is not really used before reserving swap on a device but it is used before actually swapping processes to disk which would cause a performance hit and would increase the used column above 0%.

Hopefully this clarifies things.
"Unfortunately you can't out-program stupidity"