bazzite
bazzite copied to clipboard
Default Swap is too low
I love Bazzite! But the default swap size is FAR too low. It's only set to a max of 25% of RAM or 4GB (whichever is larger). This caused a LOT of instability on my systems, which had 16GB or 8GB or system RAM - it caused stutters even in gaming (compared with Windows on the same machine).
On my desktop I upgraded the RAM to 32GB to solve the stuttering and instability issues in games, but on my laptops (16GB and 8GB) the results was that just running a few apps for a while (maybe an hour) would produce so much memory pressure that it would crash the entire kernel. It would do so faster on the 8GB machine, obviously. (On my desktop, I set zram to 50% ram, so 16G, but based on some comments in PR #2202 I might lower that to 8G.)
I recommend drastically increasing the swap profile. At least bump it to 50% or 8G. On my 16GB system, I increased zram to ram *1 (and set the compressor to zstd) - and it completely solved the stability issues. On my 8GB system I went for something less conventional, and increased the zram to RAM * 1 (7.5G of zram) with a priority of 100, and added an 8GB disk swap with a priority of 10, since I'm not convinced zram would be enough under any kind of pressure. I'm still testing that laptop, but so far so good. I might eventually add even more disk swap (I'm also questioning RAM * 1 for zram, but trying it for now.)
TLDR: The default swap needs to be higher, and maybe add a disk swap as backup.
BTW, this is like a P1 problem to me - this issue caused hard locks on all three of the systems I run Bazzite on, and 16GB of system RAM isn't so unusual.
Increased to /2, max 4096 from /4, max 4096. This fixes 8GB of ram setups but does not change how 16GB and up devices work.
We will not consider a swap file under any circumstance.
What I'm saying though is that I was seeing regular crashes, with kind of normal, web developer-ish type activity. A browser, and editor and some tools. Yes, that's memory intense, but not that much, and it was causing hard locks, just from running out of memory.
I think 4GB of zram just isn't enough on a 16GB machine. I increased it to 8GB, and haven't seen any crashes since. (I'm running a 1 to 1 on the 8GB machine, with 16GB of file swap - though it hasn't laid off to file swap even once yet.)
I think I understand not wanting to go with a swap file, but is there an explanation I can find anywhere, just out of curiosity?
(Switching to zstd may also have helped with my memory pressure.)
For what it's worth, CachyOS seems to use a 1:1 ram ratio, and zstd (or at least, they seem to recommend that in their docs).
Source: https://wiki.cachyos.org/features/cachyos_settings/#other-configurations