Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jun 2020 11:13:44 -0400
From:      Paul Mather <paul@gromit.dlib.vt.edu>
To:        =?utf-8?Q?Stefan_E=C3=9Fer?= <se@freebsd.org>
Cc:        freebsd-stable <freebsd-stable@freebsd.org>, Peter Jeremy <peter@rulingia.com>
Subject:   Re: swap space issues
Message-ID:  <FB7DCF2D-DB4A-4539-8A39-AB877C2517AD@gromit.dlib.vt.edu>
In-Reply-To: <52753cf4-57db-93d9-d217-c8f812d6bc7c@freebsd.org>
References:  <CAEC7391qs%2BA-jMpR1RyvR-BmnLyiksXHkQUjsGeePuEZJfMciw@mail.gmail.com> <20200625000410.GA10210@eureka.lemis.com> <CAEC7390VDxbYSY%2B4_fEaYxwdSPzbFWUVTdHw=vbAgq%2Bnmv09Vw@mail.gmail.com> <20200625025248.GB10210@eureka.lemis.com> <CAEC73938Wjb5MHvLW36PdoAy_nso-tSN51AhUYydC6qxY99pog@mail.gmail.com> <E8763B97-2DB7-4C77-864D-08155168E352@gromit.dlib.vt.edu> <CAEC7391AHKXd0KfJdUGKMv1QRh_AtA1BrtqaQwy3dXEoJEMoDw@mail.gmail.com> <20200626102331.GA6406@server.rulingia.com> <52753cf4-57db-93d9-d217-c8f812d6bc7c@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jun 26, 2020, at 6:58 AM, Stefan E=C3=9Fer <se@freebsd.org> wrote:

> Am 26.06.20 um 12:23 schrieb Peter Jeremy:
>> On 2020-Jun-25 11:30:31 -0700, Donald Wilde <dwilde1@gmail.com> =
wrote:
>>> Here's 'pstat -s' on the i3 (which registers as cpu HAMMER):
>>>=20
>>> Device          1K-blocks     Used    Avail Capacity
>>> /dev/ada0s1b     33554432        0 33554432     0%
>>> /dev/ada0s1d     33554432        0 33554432     0%
>>> Total            67108864        0 67108864     0%
>>=20
>> I strongly suggest you don't have more than one swap device on =
spinning
>> rust - the VM system will stripe I/O across the available devices and
>> that will give particularly poor results when it has to seek between =
the
>> partitions.
>=20
[[...]]
>> As a further piece of arcana, vm.pageout_oom_seq is a count that =
controls
>> the number of passes before the pageout daemon gives up and starts =
killing
>> processes when it can't free up enough RAM.  "out of swap space" =
messages
>> generally mean that this number is too low, rather than there being a
>> shortage of swap - particularly if your swap device is rather slow.
>=20
> I'm not sure that this specific sysctl is documented in such a way
> that it is easy to find by people suffering from out-of-memory kills.
>=20
> Perhaps it could be mentioned as a parameter that may need tuning in
> the OOM message?
>=20
> And while it does not come up that often in the mail list, it might
> be better for many kinds of application if the default was increased
> (a longer wait for resources might be more acceptable than the loss
> of all results of a long running computation).


The OOM issue is more pressing on platforms like FreeBSD/arm that tend =
to have low RAM and slow writable storage such as SD card.  There have =
been several threads on the issues this creates (e.g., =
https://docs.freebsd.org/cgi/getmsg.cgi?fetch=3D228789+0+archive/2018/free=
bsd-arm/20180819.freebsd-arm =
<https://docs.freebsd.org/cgi/getmsg.cgi?fetch=3D228789+0+archive/2018/fre=
ebsd-arm/20180819.freebsd-arm>) that have led to some insight into how =
to tune the OOM killer.  One thing that becomes clear is that the "Out =
of swap space" error message is misleading as often it really means =
"Couldn't obtain RAM in a timely fashion."  On hardware such as the =
Raspberry Pi, it's often the case that the system has enough swap space: =
it's just that it can't write to swap on SD card before the default =
vm.pageout_oom_seq passes are exhausted and so the OOM killer starts =
reaping active processes (like the clang trying to build clang:), and =
all sorts of things start to break. :-)

Cheers,

Paul.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FB7DCF2D-DB4A-4539-8A39-AB877C2517AD>