1834798 Members
2450 Online
110070 Solutions
New Discussion

High swap usage

 
SOLVED
Go to solution
Michael O'brien_1
Regular Advisor

High swap usage

Hi,

I've noticed that our database servers seem to be using a huge amount of swap space but there is still a bit of real memory available. The space seems to be used by pseudo-swap. Is this reasonable?

Swap Device
Type Avail Used
/dev/vg00/lvol2 device 4.0gb 0mb
pseudo-swap memory 6.2gb 4.6gb

The machine has 8GB of memory. The memory stats:

Total VM : 3.19gb Sys Mem : 1.41gb User Mem: 4.18gb Phys Mem: 7.98gb
Active VM: 1.65gb Buf Cache: 817.6mb Free Mem: 1.59gb

Should I turn off pseudo-swap? Or is my machine not really using swap, ie not swaping out it's just pseudo-swap reserving memory?

Will I gain anything by turning off pseudo-swap?

Thanks
Mike
5 REPLIES 5
Patrick Wallek
Honored Contributor
Solution

Re: High swap usage

As long as your usage for /dev/vg00/lvol2 is 0 then you are not paging out to disk and life is good.
Steven E. Protter
Exalted Contributor

Re: High swap usage

swapinfo -tam

Measure swap usage over time and see if its being used.

See attachment.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: High swap usage

Pseudo-swap isn't swap at all; it's simply a kernel bookeeping method that allows process space to exceed swap space. If your machine has more swap space than physical memory then there is no reason to enable pseudoswap -- there is a very small kernel overhead associated with it BUT if your machine has lots of memory and little swap then it is appropriatre to run pseudoswap. I often run boxes with 16 or more GB of memory and only 512MB of swap -- you have to have some primary swap. In this case, if psedoswap were not enabled only 512MB of process space would be allowed. If swapinfo shows no device swap (or filesystem) being used then it ain't really swapping. You can also use vmstat to monitor pageout's -- if po's are zero then you ain't swapping.


If it ain't broke, I can fix that.
Jean-Luc Oudart
Honored Contributor

Re: High swap usage

Mike,

do not turn off pseudo swap !

This is again the reserved eating up !
but as long as you do not use device swap you're ok.
Once device swap is used, you may have some performance hit.

Rgds,
Jean-Luc
fiat lux
Michael O'brien_1
Regular Advisor

Re: High swap usage

thanks guys, I'll leave the machine as is, I'll keep an eye on the swap device /dev/vg00/lvol2.

Thanks for your help
Mike