swap as software raid1 or not?

General Discussion of atomic repo and development projects.

Ask for help here with anything else not covered by other forums.
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

swap as software raid1 or not?

Unread post by BruceLee »

how do you think about setting up swap as software raid1.
default by kernel is raid0 if you setup two swap partitions on each hdd.

some people think its good to make raid1 others don't.
What do the experts say? :)
And how have you decided?

Thanks
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: swap as software raid1 or not?

Unread post by scott »

Theres a better way to do that, by setting the priority of 2 separate swap partitions to -1 you will get a stripe effect without the soft raid overhead.
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

Re: swap as software raid1 or not?

Unread post by BruceLee »

thats right, but setting priority to -1 or equal numbers doesn't create raid1 but raid0 like you said.
if in this case one disk crashes there will be just "50%" of the swapped and striped stuff and the server mostly crashes or not?
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: swap as software raid1 or not?

Unread post by scott »

Meh kind of, keep in mind just how slow memory->swap and swap->memory performance really is. Adding raid (of any kind) is just going to make that even slower. Could you gain something with an HA approach to swap, maybe.... it depends. Stuff in swap is for the most part comprised of anonymous mappings (data that does not map to a file) and if you had a failing disk it is conceivable that it could cause problems. Its hard to say though, because an anonymous mapping could literally be anything, and the application may not even be using it any more.
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

Re: swap as software raid1 or not?

Unread post by BruceLee »

ok, so your recommendation is to just leave the two swap partitions as they are, without raid, just striped by kernel.
Right?
thanks a lot
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: swap as software raid1 or not?

Unread post by scott »

Yeah thats what I do here
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

Re: swap as software raid1 or not?

Unread post by BruceLee »

great, thanks
Post Reply