0

I'm planning to setup 4 drives in a raid10 configuration, but putting separate swap partitions on each (no raid), and letting the kernel do something similar to raid0. When/if one of the drive fails and it has swap data on it:

  • The kernel may panic.
  • Any data stored in the memory of currently-running processes may be lost.

So far this seems like an acceptable failure case. Is there any other bad things that may happen that I haven't considered?

Shelvacu
  • 353
  • 2
  • 14

2 Answers2

0

Another thing can happen: if a process that was partially or totally swapped (ie: due to inactivity) must be reloaded into RAM (ie: due to external factors, as user iteration) and your swap partition dies, the swap-in process can not complete and the process will crash or otherwise go crazy.

For all these reasons, I strongly suggest against using a RAID-0 swap partition for servers. On a workstation/client it can be reasonable, but reality is that even a massive disk array in RAID-0 fashion is so slow compared to RAM, that it is functionally no different that using RAID-10

shodanshok
  • 44,038
  • 6
  • 98
  • 162
  • "I strongly suggest about using a RAID-0 swap partition for servers" What? Also, I understand that may happen, I was putting that under the umbrella of "Any data stored in the memory of currently-running processes may be lost." – Shelvacu Apr 21 '16 at 22:03
  • Oh, I intended **against**, not about. – shodanshok Apr 22 '16 at 06:08
0

Sorry, I have never been brave enough to venture into the realm of non-redundant swap. So this is not a direct answer to your question other than "don't do that".

I would like to share my view that, generally, if you're relying on the performance of swap you're probably doing something wrong. And if the performance of swap is not a concern then just leave it redundant.

More RAM is always cheaper than more swap performance!

Dan Armstrong
  • 821
  • 4
  • 6