Operating System - HP-UX
1832858 Members
3687 Online
110048 Solutions
New Discussion

Re: Adding and configuring device swap

 
Tony Williams
Regular Advisor

Adding and configuring device swap

I don't have a problem but I have a question that borders on the hypothetical. We have Very Large Memory servers from 12GB to 128GB. We are adding more physical memory to these servers. We want to keep swap a 1X or 2X multiple of memory. We have never swapped and never plan to we would just add more memory if we ever did. However in order to do this we need to add device swap. On our smaller 12GB memory servers we only have one device to use for swap. We have one 24GB swap partition. We are upgrading to 20GB main memory and we want 40GB of device swap. We are adding a 2nd swap partition on the same device as the primary. I have always thought that you interleave swap or keep them at the same priority if you have multiple disk devices. If you only have one device then its important to have the different swap partitions at different priorites becuase if you don't then you could actually create more of a problem when you try and access swap. The disk heads can't access multiple partitions at the same time and would then cause disk thrashing.

None of my coworkers and no one else I know has ever heard of changing the swap priority if you only have one device. Can someone help me and explain whether its true or not?
5 REPLIES 5
Patrice Le Guyader
Respected Contributor

Re: Adding and configuring device swap

Hello,

Help this help,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=941041

Regards
Pat
Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
Pete Randall
Outstanding Contributor

Re: Adding and configuring device swap

Sound like an amazing waste of disk space to me. If you're not planning on ever swapping, why in heaven's name would you want to set up all this swap space? Turn pseudo-swap on (swap_mem on in the kernel) to allow allow all that memory to be used in lieu of swap space and continue to monitor.


Pete

Pete
Tony Williams
Regular Advisor

Re: Adding and configuring device swap

Hi Pete,

A few applications SAP for one refuse to start if they reserve at least 1X of memory. Obviously that is impossible so swap is used as a reservation mechanism. Pseudo swap helps but deivce swap is still needed. Since we are forced to use device swap it would be nice to know how to cinfigure it properly.
James R. Ferguson
Acclaimed Contributor

Re: Adding and configuring device swap

Hi Tony:

You would want to interleave swap devices *if* you were actually swapping, which you don't want to do in the first place.

However, you would not want to configure two device swap spaces on the *same* physical disk. As you indicated, this would cause disk head movement *if* you were actually swapping (which you don't want to do in the first place). If for some reason you were constrained to this configuration, then, yes, I would make the swap priority disproportional so that one swap device was used before the other; thereby reducing "head-banging".

Of course, if you ever actually begin to do I/O for swapping, you have a server that is beginning to experience performance problems!

Given the above, by adding memory you are reducing the chances of swapping anyway.

What you *do* want to do, in addition to adding more physical memory, is to enable "pseudoswap" by setting 'swapmem_on'=1 in your kernel. With this option set, the kernel counts 75% of your memory as available for process swap reservation. This does not actually consume physical memory. It is an "accounting kludge" only.

This means that you need less actual swap space configured -- certainly no where near what you would without the option turned on.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Adding and configuring device swap

Your analysis is correct. Swap areas of equal priority are interleaved; this is good is the swap physically resides on different disks but bad if the swap areas reside on the same physicasl disk because of excessive head positioning. The primary swap is assigned prioity 1 so if you add addiotional swap on the same disk then you should assign a different priority. Now having said all this, it's rather pointless. I always say worrying about swap layout is akin to rearranging the deck chairs on the Titanic. The performance impact of significant swapping is so large that the actual layout of the swap is all but insignificant.

I should also say that your rule of 2x swap for memory is literally decades out of date. Moreover that should be 4x because of mirroring and every dab of swap should be mirrored.

For all of my servers with large amounts of memory, I typically configure about 1GB of primary swap (you must have some); I then add enough additional swap to come up to 25% of memory; enable pseudoswap; and monitor the system. You bought all of that memory so that you never swap. I just can't see the need for that much disk that is never going to be used.

Also, swap space should have nothing to do with dump space and dump unlike swap should never be mirrored.
If it ain't broke, I can fix that.