Operating System - HP-UX
1836772 Members
2222 Online
110109 Solutions
New Discussion

Should device swap all be equal size?

 
SOLVED
Go to solution
Stuart Abramson_2
Honored Contributor

Should device swap all be equal size?

i was always taught that device swap should be all equal size. Is this still true?
What happens if my 2 swap areas, both priority 1, are of two different sizes? I was taught that, since swap is interleaved you can only use up to the maximum of the smaller size. Is that right?
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor
Solution

Re: Should device swap all be equal size?

Hi Stuart:

No. Given two swap devices of equal priority but unequal size, interleaving will simply cease when the smaller space is exhausted. That is, the performance of your swap will decrease, but swap space can still be allocated.

...JRF...
MANOJ SRIVASTAVA
Honored Contributor

Re: Should device swap all be equal size?

No ,

they can be of diffent sizes but of the same priority , and the size do matter and depend on the total memory size. Interleaving make the access better but then there are min size constraints.

Manoj Srivastava
A. Clay Stephenson
Acclaimed Contributor

Re: Should device swap all be equal size?

No in this case, both swap areas will be interleaved until the smaller fills up and then the larger area will be used alone.
I assume the two swap areas are on different drives; is so, then you are correct in setting the priorities equal. However, if they are on the SAME physical drive the you should set the priorities to different values - in this case interleaving only hurts you.

Hope this helps, Clay.
If it ain't broke, I can fix that.
Kevin Wright
Honored Contributor

Re: Should device swap all be equal size?

The above answers are enough explanation, I would just add that the speed of the drives you are using is also very important if you are interleaving, they should be the same.
Account Not Used
Frequent Advisor

Re: Should device swap all be equal size?

Some other issues, Stuart:
If you are saying that by having two swap partitions you have one primary swap and one secondary swap partion, then it may be necessary to have the secondary swap partition much larger than the primary partition - depending on the size of the system memory, and what is necessary to support your environment. Primary swap, if used, must reside within the first 2GB of the boot disk, thus limiting its size.

With more than one swap partition at the same priority, the partitions will interleave until the smallest partition is exhausted - as James stated. However it is important to understand that if the devices are on the same "jbod" type controller (such as internal drives on a "K"), this interleaving may cause more harm than good since it will cause the disk controller to switch disks between each swap-chunk written. If this is the case, you may want to specify a different priority for one of the partitions.

Also, if one of your partitions resides on a boot disk, such as the primary swap partition, and secondary swap resides somewhere else, you may want to look at increasing the priority of the secondary swap to "0" so that you O.S. disk(s) are not affected until absolutely necessary (primary swap is hard-coded at priority "1").

Hope this helps,
David Lieberman
Sr. UNIX Administrator
21st Century Insurance Group
"Who moved my cheese?"