Operating System - HP-UX
1748214 Members
3300 Online
108759 Solutions
New Discussion юеВ

swapspace on dedicated disks?

 
HP Cluster
Advisor

swapspace on dedicated disks?

Current configuration:
Physical memory: 9 Gb
swapspace: 8 Gb on two devices /dev/vg00/lvol2 and /dev/vg00/lvol9
rootdisk (vg00) /dev/dsk/c1t2d0 mirrored on /dev/dsk/c2t2d0
We want to extend memory to the max. (16 Gb)
1. What is a good size for swapspace?
2. Do we get a better performance when swapspace is allocated on dedicated swapdisks?
Thanks for your help!
Ric

 

P.S. This thread has been moved from  HP-UX Technical Documentation to  HP-UX > sysadmin. -HP Forum Moderator

6 REPLIES 6
Leif Halvarsson_2
Honored Contributor

Re: swapspace on dedicated disks?

Hi,

You need to allocate swap space but, if you have enough memory, it is not used. And, for performance reason it should not be used.

So, what kind of disk you allocate the swap space on is not important.

It is normal to allocate at least the same swap size as the size of the primary memory. HP-UX reserves swap for all processes and, if there is less swap then primary memory you may get errors as "cannot reserve swap" or similar.
harry d brown jr
Honored Contributor

Re: swapspace on dedicated disks?

(1) typically I use 1.5 times memory, unless memory is "huge". Anything over 8gb can easily be matched 1 to 1 providing you aren't going to consume all of the memory. If you think you will, then use 1.2 times memory.

(2) SURE, if you can afford it, but if you aren't swapping, then it can be a waste of resources.

live free or die
harry d brown jr
Live Free or Die
MarkSyder
Honored Contributor

Re: swapspace on dedicated disks?

If you do a lot of swapping it's generally recommended that you have identically sized swap areas on more than one disc to spread the load and improve performance.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
DCE
Honored Contributor

Re: swapspace on dedicated disks?

If you have the kernel paramenter swapmem_on=1, the you have pseudoswap on. This allows you to have less than 1:1 physical swap to memory. On large memory systems it does not makes sense to dedicate extensive amounts of disk space to swap, especially since the system never actually uses the swap space, but just reserves it.

Dave
Steven E. Protter
Exalted Contributor

Re: swapspace on dedicated disks?

1.
You can safely leave the swap space alone. As long as you are not actually paging and your allocation of swap is low, the additional disk space may not be needed. To be sure, take a look at swapinfo -tam

So long as there is plenty of unallocated swap during peak operations, you will be fine. If you are concerned, you may want to add a secondary swap area of lower priority.

2. There are a number of theories on this. Many say don't mirror swap. I generally deal with systems that have two local disks. Therefore I have no choice but to put swap on the same local disk that I boot off of, which is mirrored.

If you have lots of disks, having several smaller swap areas with different priority may give better swap performance. Again, if you are not actually paging, the layout won't make a difference.

In an ideal world I like a small, minimal swap area as highest priority, normally the minimum half of physical ram. If I have any supplemental swap areas, they are bigger, ideally on their own disk and set to a higher priority number, therefore lower priority for use. That way they don't get used.

I've never had a chance top create my ideal swap layout, working with rp servers the way I have.

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: swapspace on dedicated disks?

1) The ideal "good" size is 0.25 x physical memory with swapmem_on=1 (pseudoswap enabled) so that you can use all of your memory for process space but no swapping ever actually occurs. Equally good (but more wasteful) is 1X physical memory with swapmem_on=0. This assumes that you live in a world where swapping never occurs --- which is rather common these days. My best advice is to start off with a small amount of primary swap (you must have some), mirror it --- so that disk failures do not require a shutdown -- and monitor swap usage. It's so easy to add additional swap that it's not worth worrying about as long as you leave some space in a few volume groups.

2) It's pointless to combine performance and swap in the same sentence because once swapping starts to any significant degree, it really doesn't matter. My standard response for modern boxes is that "worrying about swap layout is akin to rearranging the deck chairs on the Titanic".

3) Although you didn't ask, swap space should have absolutely nothing to do with dump space --- they serve entirely different purposes. Moreover, all swap space should always be mirrored and dump space should never be mirrored.
If it ain't broke, I can fix that.