On 10 Aug 2019, at 17:56, Georg Sauthoff <mail@georg.so> wrote:

On Fri, Aug 09, 2019 at 03:50:43PM -0600, Chris Murphy wrote:
[..]
Problem and thesis statement:
Certain workloads, such as building webkitGTK from source, results in
heavy swap usage eventually leading to the system becoming totally
unresponsive. Look into switching from disk based swap, to swap on a
ZRAM device.

Summary of findings (restated, but basically the same as found at [2]):
Test system, Macbook Pro, Intel Core i7-2820QM (4/8 cores), 8GiB RAM,
Samsung SSD 840 EVO, Fedora Rawhide Workstation.
Test case, build WebKitGTK from source.
[..]

To avoid such issues I disable swap on my machines. I really don't see
the point of having a swap partition if you have 16 or 32 GiB RAM. Even
with 8 GiB I disable swap.

https://chrisdown.name/2018/01/02/in-defence-of-swap.html is worth a read - TL;DR the kernel used (pre 4.0) to be awful about swap, but modern kernels use it to avoid paging executable (file-backed) pages in low memory. If any paging is needed, lack of swap means that the kernel will page out active code before it gets as far as an OOM kill, resulting in a longer time to recover from memory contention (regardless of whether there's an OOM kill or the system recovers naturally).

Further, a sensible amount of swap (say 2 GiB or so) means that unused anonymous pages (e.g. data that's left over from initialization, or data that will only be needed when a process exits) can be swapped out and left on disk, freeing up valuable RAM for useful work.

Basically, a sane amount of swap is healthy - old advice about large amounts of swap is not.

With - say - 8 GiB the build of a large project might fail (e.g. llvm,
e.g. during linking) but it then fails fast and I can just restart it
with `ninja -j2` or something like that.

Another source of IO related unresponsiveness is buffer bloat - I thus
apply this configuration on my machines:

   $ cat /etc/sysctl.d/01-disk-bufferbloat.conf
   vm.dirty_background_bytes=107374182
   vm.dirty_bytes=214748364

Best regards
Georg
--
'Time your programs before making claims about efficiency'
 (Bjarne Stroustrup, The C++ Programming Language, 4th ed., p. 132, 2013)
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org