1834931 Members
2496 Online
110071 Solutions
New Discussion

swap question

 
SOLVED
Go to solution
Scott Van Kalken
Esteemed Contributor

swap question

What are people's thoughts on swap?

Some people only put swap on VG00.
Some people scatter swap among different VG's.

To my mind if you've got swap on VG00 which (generally) is only two disks, it can under some circumstances be a bottleneck (even with priority).

What does everyone think?

6 REPLIES 6
Michael Tully
Honored Contributor
Solution

Re: swap question

Hi Scott,

In my opinion swap should be defined something like this:

/dev/vg00/lvol2 1024Mb (no more)

Have a different volume group on your extenal disk array with volumes of no more than 2Gb on seperate LUN's. There is no need to have heaps of swap if your system has heaps of RAM. To give you an example I have an rp8400 with 8Gb of RAM but with only 2Gb of swap. 1Gb on the internal disk and the other on my extenal disk array. I also have the priority going first to the external disk and second priority to the internal. The reason I even use the internal disk is so that the system can boot.

Also have a search and look for 'swap+priority'
which should report something useful.

Cheers
Michael
Anyone for a Mutiny ?
Sukant Naik
Trusted Contributor

Re: swap question

Hi,

I always have the primary swap space on the root disk itself.

But as the activities on the server increases, I start roping in additional disks on which I go ahead and create secondary swap space. There are two reasons for it.

1. It is difficult for me to extend the swap slice on the root disk.

2. It is ideal to have swap space on additional disk as I/O will then be split in between the root disk and the additional disk.

One question to the forum:
Can I have primary swap space on a non-root harddisk?

My two cents.

-Sukant
Who dares he wins
Patrick Wallek
Honored Contributor

Re: swap question

My view on swap is that you shouldn't every use it. If you are paging anything out to swap then you need more RAM. These vendors (who shall remain nameless) that require 20GB of swap are crazy. RAM is cheap enough now that you should NEVER page anything out to your swap area.

Minimal swap area (maybe 1-2 GB) on VG00 and turning on the swapmem_on (setting it to 1) is the best solution in my opinion.
Scott Van Kalken
Esteemed Contributor

Re: swap question

Interesting answers and thanks for the responses.

The box in question isn't swapping.

Which is good.

I like it.

I've got 4MB physical RAM and about 3GB of configured swap.

I've turned swapmem on as well (did that months ago before the ram arrived). We ran out of memory one day you see...


As I add more ram, we tend to need more reserve space. You see, I don't want to run out of reserve. The thing is that if I run out of reserve, the box decides to barf. I'm just thinking that I find an extra gig and have swap = physical ram for this particular box.

What do you think?
S.K. Chan
Honored Contributor

Re: swap question

I have not come across an installation that isolates the primary swap from vg00 (regardless of it's size) simply because I think swap bottleneck is not an issue, if it is then you got serious problem with your application. Additional swap (or secondary swap) can be added in vg00 or other VGs and usually a smart decision is to add it in non root VG. One other point that has not been mentioned is interleave swap, ideally you would want (if you have more than 1 device swap) all your swap size to be the same and priorities to be set the same to enable interleave swap for better performance.
just my thought ..
Scott Van Kalken
Esteemed Contributor

Re: swap question

They're all good answers.