The out-of-swap killer makes poor choices

Konstantin Belousov kostikbel at gmail.com
Wed Feb 24 18:36:17 UTC 2021


On Wed, Feb 24, 2021 at 10:34:23AM -0700, Alan Somers wrote:
> There's another silly problem that I didn't mention in my original post.
> The old rule of thumb is that the swap partition's size should be twice as
> large as the amount of RAM.  However, that's no longer possible in many
> cases.  The kernel imposes a hard limit of 64 GiB (on amd64 at least) on
> the usable size of any swap partition, and many servers now have far more
> than 64 GiB of RAM.  So the advice needs to change with the times.  I don't
I do not think so. The usable size of the swap is determined by the
amount of swap metadata we pre-configure at boot time. Usually it is
sized proportionally to the available physical memory, but you can
override swap zones size manually with the knob.

> know what the best size would be for a modern server, but I would guess
> that it must be at least several times the RSS of your largest process, and
> also at least one tenth of RAM (for use as a dump device with compressed
> core dumps).
> -Alan


More information about the freebsd-hackers mailing list