On Sat, Feb 29, 2020 at 4:33 AM Wols Lists <antli...@youngman.org.uk> wrote:
>
> I just have a massive swap space, and /var/tmp/portage is a tmpfs. So
> everything gets a fast tmpfs build, and it spills into swap as required
> (hopefully almost never).
>

I can articulate a bunch of reasons that on paper say that this is the
best approach.

In practice I've found that swap on linux is sub-optimal at best.  I
only enable swap when I absolutely have to as a result.  I'll reduce
-j to lower memory demand before adding swap usually.  On more
RAM-constrained hosts I'll enable swap when building specific
packages, or try to avoid those packages entirely.

Maybe something has changed in the last few years and swap is actually
useful, but I'm skeptical.  I always tend to end up with GB of free
RAM and a churning hard drive when I enable it.  On SSD I'm sure it
will perform better, but then I'm running through erase cycles
instead.

Like I said, on paper adding swap should only make things better.
But, that is only true if the kernel makes the correct choices about
prioritizing swap vs cache use.  Sure, I could set swappiness to zero
or whatever, but then that just turns swap into a NOOP best case and
it isn't like I have OOM issues, so why bother?.

-- 
Rich

Reply via email to