Closed yusssufff closed 2 years ago
please first define what you consider "LOW RAM" here. second, you can follow Gentoo documentation here : https://wiki.gentoo.org/wiki/Zram
Hi, Yes gentoo documentation can help. But as the aim is to offer something compiled 'out of the box', i think this could be included in Mocaccino... I think, from my experience with various machines, bellow 6GB RAM, zram comes-in very usefull. Under 4GB ram, zram is almost necessary for using GNOME.
What you could do is investigate if you can make it to work at all as things are now. If something is missing let us know. Not sure if at this point there is a need to make this work "out of the box".
Well this usually works (see bellow). But i wonder if "outofbox" would be an option. This is what gentoo-based calculate-linux offers: vi /etc/systemd/system/zram.service [Unit] Description=Service ZRAM [Service] ExecStart=/usr/local/bin/zram-start ExecStop=/usr/local/bin/zram-stop Type=oneshot RemainAfterExit=true [Install] WantedBy=multi-user.target vi /usr/local/bin/zram-start #! /bin/bash # Charge le module modprobe zram # Compression ZSTD echo zstd > /sys/block/zram0/comp_algorithm # Taille 3Go echo 3221225472 > /sys/block/zram0/disksize # Création ZRAM mkswap -L zramswap /dev/zram0 # Activation ZRAM swapon -p 100 /dev/zram0 chmod +x /usr/local/bin/zram-start vi /usr/local/bin/zram-stop #! /bin/bash # Désactivation ZRAM swapoff /dev/zram0 # Reset du ZRAM echo 1 >/sys/block/zram0/reset # Suppression du module rmmod zram chmod +x /usr/local/bin/zram-stop systemctl --system daemon-reload systemctl enable zram systemctl start zram
following this process does work for me. but for Mocaccino to be able to be "out of the box" gentoo for regular users, that would be a great improvement to include it by default i think.
I think if we add https://packages.gentoo.org/packages/sys-block/zram-init to layers/sys-fs users will also have the needed systemd service files available. That would at least make it a lot easier to configure it.
Hi, some work towards this has already started. At the moment we don't ship it by default, but you should be good to go to enable it by installing the zram profile and reboot:
luet install system-profile/zram
Its a very nice work. Very nice and easy to start! Maybe 32GB is a bit too much as default? Shouldnt we aim something more around 8GB?
I just tested this on my old macbook and it works like a charm. I indeed notice I have 32GB swap. Perhaps we could tune this down to 8GB indeed!
This is now fixed. After upgrade you must run etc-upgrade and reboot to apply this.
I think using zstd compression algorythm for zram would really be an improvement. Nearly same speed as the currently used lz4 (single thread), better speed with multi thread support and better compression ratio.
ISSUE: WITHOUT A DEFAULT "SWAP ON ZRAM", LIVE-USB OF MOCACCINO IS MORE HARD TO USE (NO SWAP), AND SLOWER ON LOW RAM SYSTHEMS AFTER INSTALL (SWAP ON DISK INSTEAD OF THE FASTER RAM)
There is a shift towards default " swap on zram " on many serious linux distributions these days: Fedora, EndlessOs, Calculate-Linux, AltLinux... There are various benefits for the company or home user. Mostly the system is much more reactive whenever starting to swap (swap on zram being much more reactive than swap on hdd or ssd).
What about joining the move, and enabling swap on zram " by default " in MocaccinoOS Desktop, like Calculate, Endless, Fedora, Alt...? It would be very helpful for the typical case of home users who have small RAM amounts available and experience regular swapping.