Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
I usually run the default arch zram config which is 50% of the RAM. For your case I'd go with 2 or 3 GB
Arch doesn't use zram by default?
Sorry, it's been a while since I did the install, what I meant is the default config of: https://wiki.archlinux.org/title/Zram#Using_zram-generator
For whatever it's worth - I have a laptop with 4GB of RAM and a 4GB ZRAM device, and it can't use all the ZRAM before everything grinds to a halt. I think the way ZRAM works best is if it can "swap out" (compress) anonymous pages that aren't actually needed again right away, freeing up the fast memory for disk caching and other memory needs.
In my case, I think I can reach a point where the amount of memory Linux needs simultaneously active goes beyond the 4GB of RAM, so it's just compressing/uncompressing forever and getting nowhere.
So, I think I'd argue that maybe you can't go too big? I think only anonymous pages can get compressed, and there's probably only so many gigabytes of those in memory at any given time.
I use a 4gb ram zram device on 2gb ram devices and can fill it up without the system grinding to a halt.
Might need to play with some of the other sysctl parameters