Re: Swap on SSD's (with softraid 1+C)

2022-09-07 Thread Nick Holland

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.



Re: Swap on SSD's (with softraid 1+C)

2022-09-07 Thread Janne Johansson
> (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.)

That advice is ridiculous for such a machine, yes.
Depending on if you want to have a full crash dump done to swap and/or
hibernate to swap, you might be forced to have it at RAM-size plus
some extra, but for the ordinary run of the machine it should not be
needed to have a large swap at all, unless you run 40+G worth of
applications all the time.
If you did have 72G swap and actually used half of it, waiting for a
normal drive to un-swap that amount would be sad and boring.

-- 
May the most significant bit of your life be positive.



Swap on SSD's (with softraid 1+C)

2022-09-07 Thread Erling Westenvik
Hello,

I'm making the transition from SATA to SSD. A late bloomer.. My setup
for years have been a semi-FDE softraid on two physical disks, sd0 and
sd1, where the sd0a and sd1a chunks make up a RAID 1 volume sd2. sd2
contains an unencrypted root partition, sd2a, and the remainder of the
filesystems reside in sd2p -- a CRYPTO partition that decrypts to sd3
and where sd3b constitutes swap (sysctl vm.swapencrypt.enable=0).

(I don't encrypt root because I need to be able to reboot and decrypt
the machine from remote locations but lack any sort of KVM, thus I have
a somewhat elaborous setup involving a statically compiled sshd "daemon"
that is invoked from /etc/rc.)

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?

(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.)

Kind regards

Erling