Date: Wed, 24 Feb 2021 11:59:33 -0800 From: Mark Millard <marklmi@yahoo.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Alan Somers <asomers@freebsd.org>, FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: The out-of-swap killer makes poor choices Message-ID: <EA37F4D3-BCED-405B-BF70-2A97B19A9444@yahoo.com> In-Reply-To: <YDacl5/AFzFA4nkg@kib.kiev.ua> References: <CAOtMX2jYmrK7ftx62_NEfNCWS7O=giHKL1p9kXCqq1t5E1arxA@mail.gmail.com> <CAOtMX2i3Njo=KBP=99_G0%2BKuSa00CVgNvacmzhTaoZUYEhwPPA@mail.gmail.com> <YDYyQ1V/hEAGV%2ByJ@kib.kiev.ua> <1984125.0OzZcVfBr4@ravel> <CAOtMX2iYr4NDYE0xHSa_w1hA5XQ2m9cA28NzPoGbfzAKKox9aQ@mail.gmail.com> <YDacl5/AFzFA4nkg@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2021-Feb-24, at 10:36, Konstantin Belousov <kostikbel T gmail.com> = wrote: > 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. There was a period of time when the 128 GiByte RAM ThreadRipper had its previous 192 GiByte swap partition use rejected and I had to split it into 3 64 GiByte ones. Later I saw a checkin that was a correction to some calculation (vague memory) and I retried having one 192 GiByte swap partition and it was again allowed. The ability to dump to a swap partition when there was a 64 GiByte limitation with 128 GiByte of RAM had implications for the configuration. I actually arranged having a partition that was only used for dump's potential use. That took some rearrangement to form a large enough space, making other tradeoffs to do so. (I'm not sure if I can find the commit that lead to me switching back to more than 64 GiByte for a swap file on the large memory machine. I do not remember details any more.) >> 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). =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EA37F4D3-BCED-405B-BF70-2A97B19A9444>