On 9/7/22 09:05, Erling Westenvik wrote:
Hello,
...
My question is: Should I let swap be outside RAID altogether? Like "directly" on the physical disks as in sd0b and sd1b? I mean, why have softraid waste CPU cycles making swap content (if any) redundant? What do you people do?
1) if you are using swap, you are doing it wrong. The additional processor load of encrypting swap twice is going to be lost in the screams of horror and malcontent from your users and you. Really is a case of optimizing the positioning of the deck chairs on the Titanic. Things are going down, people are unhappy. They won't notice the tiny difference. 2) Swap on softraid means you can re-use the swap space for other things when you decide "I never use swap, but I wish I made my /var partition a big bigger". It is difficult to now create a new softraided space on an unencrypted part of the drive. 3) you said "Softraid 1+C", so having non-redundant swap isn't going to accomplish what you want when a disk fails. IF you are using swap and the swap disk fails, I'm pretty sure your system is going to have a bad day.
(Follow up question as for swap sizing: In the age of 32+ GB RAM, do you people really follow the recommendations on having swap at least twice the amount of RAM? I'm hoping for 72GB RAM and that would steal 144GB of my 525GB disks, something that seems ridiculous.)
depends. Using 525GB of disk if you are building a firewall system and only need 20G is also ridiculous. But yeah 2xRAM dates back to ...well, I can't think of a time when it was ever a good idea (well, in an academic environment, I once used an IBM mainframe with 16MB RAM and two 16MB RAM disks for swap, the swap was ALMOST like regular RAM. That might have made some sense, but I never got to see how the swap actually was used and worked on the thing). As mentioned above, the advantage of allocating 144G RAM to swap is you now have 140G you could reallocate to something else if you later decide 144G was massively overkill for swap, but you didn't make a big enough /tmp or /var partition or need a separate /var/www. If you need all the 500GB of SSD, you probably should get a bigger disk. If you don't need it, leave a good chunk unallocated. Swap is kinda unallocated, right? :) So in short: I see no real disadvantage to swap on RAID1+C, and some potential advantage. You might wish you did, you are unlikely to wish you didn't. Nick.