On Sunday, June 7, 2020 11:51:38 AM MST Konstantin Kharlamov wrote:
Hello! I see a proposal to enable zram by deafult¹. If I correctly
understand this is the thread where it's being discussed. I have a few
questions, answers to which probably would be nice to add to the
1. It says ZRAM gets enabled on upgrade. What's gonna happen to systems
with ZSWAP is enabled? I guess it doesn't make sense to keep them both.
2. I was a bit shocked to see comparison to a system with 16GB of RAM.
I admit the more the better, but most people still have only 8GB on
their laptops/PCs, and sometimes there's just 4GB of RAM.
My question is: given people with 4GB of RAM, are you sure that
handing 2GB over to ZRAM gonna improve their experience?
The third question touches the paragraph "Why not zswap?". The only
point it mentions is that swap-device is not encrypted. Fair enough,
although I wonder why this never has been regarded as a problem before.
An important consideration is that zram is *also* not encrypted. If that's
enough to rule out zswap, it should be enough to rule out zram too.
I have an actual user experience which suggests ZSWAP might be a
choice. My gf is using Macbook with Fedora, with 4GB of RAM and an SSD
device. She loves opening lots of tabs in a browser, and as you can
expect RAM gets quickly exhausted.
With 2GB of SSD SWAP she was getting lags sometimes ("sometimes", SWAP
on SSD is much faster than on HDD). 3-4 months ago I enabled 1GB of
ZSWAP, and lags are gone.
Would your proposal with ZRAM help here? Sadly no, there's more to the
story. The 2GB of SWAP turns out not to be enough, it gets regularly
exhausted. I even had to create a script that pops up a warning when
SWAP is low on space, so she'd close some tabs² (for some boring reason
it's a bit hard to increase SWAP space there).
Let me emphasize that: 3GB of compressed RAM (ZSWAP + SWAP) is not
enough! The moral of this story is that you can't get away with only
ZRAM without any disk SWAP. You need disk SWAP. And if you have disk
SWAP, ZSWAP fits more nicely there as a compressing buffer before the
data finally spills over to disk.
Zswap sounds like an excellent idea to look into instead of zram. Not only
that, but it'd allow traditional entry in fstab to configure it, instead of
some systemd magic that nobody knows about.
John M. Harris, Jr.