Re: swapfile query

From: Greg 'groggy' Lehey <grog_at_FreeBSD.org>
Date: Sun, 20 Aug 2017 09:39:19 +1000
On Saturday, 19 August 2017 at 16:00:28 +0100, tech-lists wrote:
> Hello list,
>
> (freebsd-current is r317212 on this machine)
>
> I have a machine with 128GB RAM. When 12-current was installed, for some
> reason the swap partition was set to 4GB. I see sometimes via top and
> also via daily status reports that sometimes the machine runs out of
> swap. It doesn't crash the machine though.
>
> I know how to add more swap with a swapfile.

That's one way.  It's really better to use a swap partition.  If you
repartition the SSD for whatever reason, you should consider creating
a larger swap partition.

> 1. should I make more than one swapfile, say 4x32GB or will it be ok
> with one 128GB swapfile?

It doesn't make any difference, but 128 GB seems excessive.  You might
like to try with one 32 GB swap file and see if that's enough.  On my
machine I have 32 GB of memory and 10 GB swap, and I don't have much
of a problem with that.

> 2. will the 4GB already there as swap play nice with a swapfile, or
> multiple swapfiles? Or should I deactivate the 4GB swap partition
> first?

Yes.

> 3. should total swap be 1x 2x or some other multiple of RAM these days?

It never needed to be.  The only issue is that if you want processor
dumps, you once needed a swap partition (and not a swap file) at least
marginally larger than memory.  With compressed dumps, that
requirement is relaxed, but I suspect that a 4 GB partition could be
too small.

Greg
--
Sent from my desktop computer.
Finger grog_at_FreeBSD.org for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA

Received on Sat Aug 19 2017 - 21:39:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:12 UTC