Hello, In the Message; Subject : Re: Let's use ZRAM! Message-ID : <9b05760a-7117-b422-b763-27982c8da51f@suddenlinkmail.com> Date & Time: Mon, 31 Jul 2023 21:13:08 -0500 [DCR] == "David C. Rankin" <drankinatty@suddenlinkmail.com> has written: DCR> On 7/31/23 00:32, Masaru Nomiya wrote: [...]
What is ZRAM?
ZRAM creates a block device in RAM where pages that would otherwise be written to swap (disk/SSD) are instead first compressed, then stored. This allows for a much faster I/O of swap, and also, the data compression provides a significant amount of memory savings.
A downside of ZRAM is that it uses some CPU for compression, but this is usually negated by the gains achieved from avoiding disk swap and the overall memory savings of compression. So keep those things in mind per your usage.
I found ZRAM on a site about Fedora, looked up ZRAM on it, and adopted it. However, the method described for Fedora did not apply to openSUSE, so I installed the following, which I found in YaST2, out of the blue; systemd-zram-service-0.2.1-12.23.noarch libudisks2-0_zram-2.9.4-116.23.x86_64 zram-generator-1.1.2-14.28.x86_64 Here, I found /usr/lib/systemd/system/zramswap.service, so I tried # systemctl enable zramswap.service and it worked! Then, I searched for a description of this in openSUSE, and found the site I mentioned before. According to the description on this site, we do not need anything except systemd-zram-service-0.2.1-12.23.noarch, but I haven't uninstalled others. DCR> That's damn interesting. Only thing I don't get is how does DCR> adding a compression layer improve performance? Wikipedia says the following; When used for swap, zram (like zswap) allows Linux to make more efficient use of RAM, since the operating system can then hold more pages of memory in the compressed swap than if the same amount of RAM had been used as application memory or disk cache. DCR> I can see swap/read/write benefits for systems that heavily swap DCR> - but for systems that don't swap at all - I guess there DCR> wouldn't be any benefit? Wikiepdia also says the following; Using zram also results in significantly reduced I/O for Linux systems that require swapping. Is there any system that does not swapping,I wonder...? Anyway, I think ZRAM setting is a must for SSD users like me. Since there is no need to consider data loss in case of failure, to further reduce access to the SSD, I have changed the default of vm.dirty_writeback_centisecs = 500 to vm.dirty_writeback_centisecs = 6000. Regards. --- ┏━━┓彡 野宮 賢 mail-to: nomiya @ lake.dti.ne.jp ┃\/彡 ┗━━┛ "Maddox hopes that empowering users to pick their own algorithms will get them to think more about what’s involved in making them. " -- Bluesky's Custom Algorithms Could Be the Future of Social Media --