Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In follow-up to this previous question (and it's excellent answer), I am curious to know if running swap on a RAID5 might not be better than on a RAID10.

My thinking is that you might lose a bit on the performance because it wouldn't be purely striped, but if a drive goes down you can rebuild it from the missing parity bit.

Perhaps that doesn't make sense, and stripe-and-mirror would be better.


Thanks for the comments regarding buying more RAM - however, please note that that is not what this question is about. For the sake of this question, you can presume that the system has already been maxed. I am fully aware of the preference for "real" memory vs "virtual" memory.

Several environments expect or require swap to be configured (one of note is the system I work most heavily with that requires a swap segment at least equal to the physical on the machine for the environment to be supported by the vendor). It is, therefore, prudent to consider the *best way to implement swap for such an environment.

share|improve this question
Yikes, swap equal to the RAM? Even Oracle has stopped recommending you create any more swap than 16GB. – sciurus Apr 30 '11 at 21:46
@sciurus - yes: it's a requirement for both the Oracle instance for the tool, and the tool itself (if not hosted on the same server) – warren May 1 '11 at 2:50
On a laptop (or desktop for that matter) if you plan to use hibernate under Linux than you need at least RAM-size-and-more as it doubles as the hibernate storage are that Windows keeps a separate file for. Though of course the RAID10/RAID5 question is unlikely to be relevant to a laptop... – David Spillett May 1 '11 at 20:27
up vote 4 down vote accepted

As the others have said, buy more ram. However Chopper3's answer is not exactly correct.

Given that both provide fault tolerance, and leaving aside capacity, the reason for choosing one over the other would be all about performance - and that depends on the workload. For a system with few processes but big memory requirements (e.g. AI engines, FEA) then you want fast bandwidth - raid 5. For a system with a lot of context switching it's about reducing latency - hence raid10.

share|improve this answer
there does come a time when you cannot just add more RAM - perhaps you've hit the capacity of the system (whether it's 32G in a desktop or 512G in a server) – warren Apr 30 '11 at 4:41
Then you could leverage an SSD drive... – ewwhite Apr 30 '11 at 18:45
if your RAID 5 has a failed drive, the rebuild process can kill your I/O performance in general. And on a swap usage, that would be very painful! – tegbains Apr 30 '11 at 20:39

It makes no sense no, R10 would be better, but you should really try to have enough real memory to not have to care.

share|improve this answer
+1 Get enough RAM that swap performance doesn't factor into normal operations. – Chris S Apr 29 '11 at 15:38
+1 But do make sure your server has a bit of swap, as it lets the server use the RAM more efficiently. – pehrs Apr 29 '11 at 15:49
Agreed pehrs, and while I do care about swap performance I wouldn't but too mcuh effort that way myself. – Chopper3 Apr 29 '11 at 16:46
absolutely - having enough RAM is always the intent. But swap happens. – warren Apr 29 '11 at 16:57

Buy more RAM, or at least enough to cover your application's needs. You shouldn't worry about the speed of swap unless you plan on swapping often. You shouldn't plan on swapping often... Either way, RAID 10 is the better option.

share|improve this answer

For swap space I would not recommend RAID5. There is a write performance issue with RAID5 that particularly affects workloads that involve many small writes, because every updated block potentially involves an extra read so that the controller can correctly compute the new parity block [on a 3-drive (or 3-plus-hot-spare) R5 array each each stripe has three blocks, two for pure data and one for parity information]. Neither 3-drive RAID10 (not one of the standard arrangements but supported by Linux's software RAID and some hardware controllers, IBM's controllers call it RAID1E).

Of course if you do not actually expect the swap to be used for anything other than holding a few pages that haven't been accessed for days (so they are swapped out to make room for cache/buffers or other more active use), this is all moot and you should just go for what-ever arrangement is right for the rest of your expected workload.

Summary of the options:

Arrangement         Reads              Writes                             Space        Redundancy
RAID5 (3 or 3+hs)   Similar to RAID0   Often slower than bare drives      2 drives     Can survive one drive failing
RAID10 (4 drives)   Varies**           Usually similar to bare drives**   2 drives     Can survive one drive failing and 4 of the 6 "two drive" failure cases
RAID10 (3 drives)   Varies**           Usually similar to bare drives**   1.5 drives   Can survive one drive failing

** RAID1's reads are usually assumed to be around the same performance as bare drives, though an intelligent controller can improve this for both sequential and random access depending on workload pattern and array layout (the Linux RAID10 driver offers a number of layouts that can sometimes offer RAID0 like performance for some workloads). Similar for writes which are usually similar to writes to single drives. Some of the layout options for improving read performance can impact write performance (by increasing the number of head movements required or their average distance) so use the advanced options with care.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.