Setup ZRAM using zram-generator in Arch Linux.
Recently many Linux Distro's started offering Zram as an option during install or as default Swap type to supplement low-end hardware devices.
below is the small excerpt from Wiki,
after reading several articles i was very much interested to try it and see if this really makes a difference when compared to separate Swap partition.
earlier i posted how to easy install Arch Linux using archinstall script, which too offered Zram feature for swap.
after spending some reasonable time with Opensuse 15.4 KDE which was a rock solid experience, i was waiting to try Gnome 43, i had these options either wait for Fedora 37, upgrade Opensuse Leap to Tumleweed or try Arch Linux. Gnome 43 was made available in Arch Linux a bit earlier compared to latter, so i decided to give it a try but unfortunately archinstall script was broken, this is when i followed Arch wiki for installation and was successful with installation.
i will share the step by step installation in separate Post as its bit time consuming.
The easiest way to set up zram is by installing package Zram-Generator.
open this file as Sudo with a text editor of your choice.
/etc/systemd/zram-generator.conf
usually most of the articles suggest you to enable half of the ram size as swap.
like ram/2 etc.. here i want zram as same size as my systems physical ram i.e 8G.
so i entered just ram.
after saving the file, re boot the system.
Observations:
unlike swap, Zram will only be used if your Physical memory runs out. we can put it in other way as zRAM will only get used if it's needed, so enabling it will have no effect if you don't need it.my ZRAM consumption was always at ~300 to 400Kb when surfing.
Reduced HDD clicking noises, with Swap partition i always had swap consumption at ~500M to 1 G of space even if we have free space on Ram based on how the swapiness is set(Swap tendency). which made frequent/increased read write operations on HDD.
running virtual machines with zram was quick and responsive than separate swap partition.
as you can see from below snap zram will pitch in only when needed and system was stable and no lag was noticed.
Zram is definitely a best add on to improve system performance.
Comments
Post a Comment