Operating System - HP-UX
1836739 Members
2982 Online
110109 Solutions
New Discussion

How much free swap space.

 
SOLVED
Go to solution
Shawn Miller_2
Frequent Advisor

How much free swap space.

I have a general question. What percentage of free swap space is good and at what point should you be concerned?
7 REPLIES 7
harry d brown jr
Honored Contributor

Re: How much free swap space.

I usually say it depends on how much memory you have, but at least 1 times (for systems with a lot of memory, like over 10GB), and in most cases 1.5 times, rarely 2 times (which is where you need to buy more memory).

live free or die
harry
Live Free or Die
Ross Zubritski
Trusted Contributor

Re: How much free swap space.

The "rule of thumb" that we use here is 1.5X physical memory.

Regards,

RZ
Pete Randall
Outstanding Contributor
Solution

Re: How much free swap space.

Sorry, for the simplistic answer, but I get concerned if I'm swapping at all. Swapping is OK as a last resort but you should really try to keep everything in memory.

Pete

Pete
Patrick Wallek
Honored Contributor

Re: How much free swap space.

You NEVER want to swap.

100% free swap is what you want.

If you see anything other than that, then you need to add more RAM.
A. Clay Stephenson
Acclaimed Contributor

Re: How much free swap space.

While there are always exceptions, the best answer is that you should not be swapping at all. Typically, I configure systems with a very small amount of primary swap (256-512MB - you must have some); enable pseudoswap, and that's it. Monitor the system a while to determine if additional swap is needed. If you want to improve performance slightly (at the cost of wasted disk that should be mirrored), then configure 1x swap and disable pseudoswap. The metric that you should be concerned with is the pageout rate - small values may be ok because memory-mapped files might be in play.
If it ain't broke, I can fix that.
Sridhar Bhaskarla
Honored Contributor

Re: How much free swap space.

Hi Shawn,

Swap configuration affects the following.

1. To reserve the swap for the processes in case for future
2. To actually hold the pages if paged out

So, the total column in "swapinfo -t" is a combination of both.

"Looking at free swap" alone is not sufficient. If you defined huge amounts of swap areas, your "swapinfo -t" may give very less percentage of swap being used. However, your system may be doing pageouts.

On the other hand, if you alloted minimal swap, your swapinto -t may look around 90% and your system may not be paging at all.

So, the key is to look for pageouts. You can use "vmstat 2 20" to identify such pageouts as in 'po' column. Or use the same 'swapinfo -t' and observe "kb used" column for the device swap areas (not the memory field).

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Michael Steele_2
Honored Contributor

Re: How much free swap space.

You start worrying with Total reaches ~85%. And you use this command for the metric:

swapinfo -tam

Although you never want to swap, or page out, you do use swap. In fact, you won't boot without a minimum, nor launch application processes without more than the system minimum. (* System minimum is how much HP-UX uses at boot time *)

A nice discussion about swap and pseudo-swap, which is what your application processes rely upon, can be found under: /usr/share/docs and I believe the file is called MEM_MGT, but grep on "swap" once there.

Also, it???s hard to come up with a reliable formula anymore for determining swap based upon the size of physical memory. Especially when you get huge amount of RAM like some HP clients; 32 to 64 gigabytes, for example. So using the 2 time formula renders value around 64 to 128 gb, and you don't have that kind of disk space. So factor in 400 mb for a crash dump as well as the number of application processes on the server and there pseudo swap requirements. Start around 1.5 gb and adjust accordingly. See what the application developer wants.
Support Fatherhood - Stop Family Law