On 6/16/19 1:14 PM, Wols Lists wrote:
I'd have a single /home partition
I was thinking of the other OS as more of a live distro copied to the
system than anything else. I wasn't thinking that the OP wanted to
actively use the alternate distro frequently. As such, I figure that
most customizations can live on the main OS and it's associated home.
Drives are cheap. The old "swap is twice ram" rule actually isn't an
old wife's tale - the basic Unix swap mechanism NEEDS twice ram.
No, it doesn't. Not any more. It hasn't for quite a while.
Swap was FAR more important when there wasn't enough ram for the
server's workload. Or when the workload was transient like a multi-user
system. (Think terminals and / or telnet and / or ssh sessions for many
users logged in and sporadically using the system.)
Red Hat's recommendation last I looked was the following:
If the system has ≤ 2 GB of memory, have 4 GB of swap (if you can).
If the system has > 2 GB of memory, have the same amount of swap as memory.
If the system has > 16 GB of memory, have 16 GB of swap.
Take a look at the output of free on most systems. I'm betting that you
won't find very much swap used, if any. So dedicating 64 GB to swap on
a machine with 32 GB of memory is … silly. Especially if you never have
more than about 100 MB ~ 1 GB of swap used (if that).
You can probably get away with < 1 GB of swap on many systems. But
there is a different thing where that small amount of swap starts to be
an issue. That's when you want to do things like take a dump of kernel
memory and the stack. That does need some space. But I think 1 or 2 GB
is plenty.
Okay, optimisations turned "must" into "should", and the swap mechanism
was seriously revamped many moons ago and may have changed things
completely (I've never managed to get anyone knowledgeable to tell
me what happened), but what I do is always ...
We've also drastically changed how we use Unix systems. We no longer
have 25 ~ 250 people logged into them via terminals. Now most Unix
systems are dedicated to a single task, be it web serving, or a
database, or something else.
Plus, we don't want those workloads to be running in swap, so we give
the servers more memory thus making them even less likely to hit swap.
Multiply my mobo's *maximum* ram by two. For *each* disk, create a swap
partition that size. Add all swap partitions in with equal priority.
I think that's bad advice and I discourage that. Especially if you're
running all SSDs and your system can take half a TB of memory. Do you
/really/ want to dedicate 1 TB of each SSD to swap? Just how big are
the SSDs anyway? ;-) Also, if you've got eight or more SSDs, your
recommendation would mean that you have 16 times the memory as swap. It
would be even worse on a server with 24 x 2.5" SSDs. That would be 48
times the memory.
It has been pointed out that this is not necessarily a good idea,
a fork bomb would cause havoc because the machine would grind to a
swap halt long before the OOM killer realised anything was wrong, for
example, but it suits me especially as I put /tmp and /var/tmp/portage
on tmpfs.
To each his / her own.