1835910 Members
3061 Online
110086 Solutions
New Discussion

SWAP MIRROR?

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

SWAP MIRROR?

I am adding a 2gig swap file to ease some contention. Should you always mirror a swap file?

Thanks,
Bob
UNIX IS GOOD
8 REPLIES 8
S.K. Chan
Honored Contributor
Solution

Re: SWAP MIRROR?

Not necessary. You don't have mirror the additional swap (whether it's a fs swap or device swap). Mirroring it will introduce some level of overhead and we all want swap to be fast. But I always mirror additional swap that I added if and only if the swap comes an lvol in the root vg (ie vg00), no particular reason, I just want to be consistent. If my additional swap is on a different vg (non-root vg) then I don't mirror it.
Patrick Wallek
Honored Contributor

Re: SWAP MIRROR?

I ALWAYS mirror my swap. Whatever overhead the mirroring takes, is more than made up for by the fact that is mirrored.

What would happen if the disk drive that your additional non-mirrored swap is on decided to die? You would be in trouble because your swap is suddenly inaccessible.

If it is mirrored, and one of the disks dies, then the other one takes over and you can keep running.

A. Clay Stephenson
Acclaimed Contributor

Re: SWAP MIRROR?

Hi:

I'll have to side with Patrick on this one. Always mirror your swap unless you don't mind your box crashing when the swap disk dies.

If it ain't broke, I can fix that.
Wodisch
Honored Contributor

Re: SWAP MIRROR?

Hello Robert,

see it that way:
if you have a bad block on a data disk, what will happen?
The application accessing it (well, trying to) gets an error - but your systems keeps on running...

now, what happens if you have a bad block on the swap space?
Your whole system dies immediatly (and dumps core - which might be the same space on disk, so the core-dumping runs into problems itself ;-) not so funny)

The moral: always mirror your swap space!

Just my $0.02,
Wodisch
Michael Tully
Honored Contributor

Re: SWAP MIRROR?

Hi,

Whilst I agree that the swap partition should
be mirrored on any internal drives, if you have
other swap partitions on RAID5 I believe it not
necessary to mirror. With RAID 5 basically looking after the disk in case of fail-over mirroring it will add overhead. Now this also depends on the type of disk(s) being used. If your using a SAN because of the caching such hardware provides I see no harm in mirroring at all. So in conclusion it may come to down to these factors:

What hardware is being used
Can you afford to mirror
Can you afford NOT to mirror.
Always mirror any internal disks.

My 3 cents worth
-Michael
Anyone for a Mutiny ?
Patrick Wallek
Honored Contributor

Re: SWAP MIRROR?

You do have a good point Michael. I always assume that my swap will be on external disks on not on a SAN or some type of RAID unit. If you do have your swap on a RAID5 system, then you are correct in that you probably do not want to mirror it.
Nobody's Hero
Valued Contributor

Re: SWAP MIRROR?

Thanks All,
I'll start the mirror process.

Bob
UNIX IS GOOD