Multiple zram devices

2024-02-15 08:35:12 :watch: notebook1 in ~
○ → zramctl
/dev/zram1 zstd 4G 1.3M 16.7K 124K 4 /var/compressed
/dev/zram0 zstd 982.9M 4K 59B 20K 4
/dev/zram2 zstd 982.9M 4K 59B 20K 4
/dev/zram3 zstd 982.9M 4K 59B 20K 4
/dev/zram4 zstd 982.9M 4K 59B 20K 4

Is this just the default setup for 4 cpu processors?

I guess you mean that 4 x zram devices = 4 x Core of CPU.
That is WRONG, you have 5 x zram devices /dev/ram[0,1,2,3,4]

But they have nothing to do with number of cores. Your Zram setup looks like a mess to me:

This is for your hard drive, but not RAM.

  • Would you like to swap the cache to the hard drive? → If yes, why not zswap?
    I am pretty sure, zswap is default. You don’t need to set it up manually.


  • One Zram device is sufficient in most cases
    • You have to disable zswap manually.
    • swap cache should be compressed in RAM, not in the hard drive.

You should follow Arch wiki. Do not follow false info in random websites.

No one knows what you did to get the result that you saw and posted.

See also the link to the Arch Wiki: :wink:

zram - ArchWiki

OK! Followed the Arch Wiki…
cat /proc/swaps

Filename Type Size Used Priority
/dev/zram0 partition 8052260 0 100
Thanks for your encouragement :smile:

Just to mention. Thats ~8gb. Which is pretty modest. We dont know your physical ram size, but in my case with 16gb of memory (actually 13.5 available) I still need double that in zram in order to successfully compile the largest packages.
While such a big SWAP may not be a requirement for you… I would like to mention at least that zram is functional, along with compression, up to that size or larger.
For example. If using zram-generator;

zram-size = ram * 2
compression-algorithm = zstd
swap-priority = 100
fs-type = swap

(note the arithmetic of “ram/2” or “ram*2”, which can be augmented any which way)

1 Like

I think I’ve got it:
2024-02-18 15:42:17 :watch: notebook1 in ~
○ → lsblk
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 300M 0 part /boot/efi
└─sda2 8:2 0 931.2G 0 part /
zram0 254:0 0 7.5G 0 disk [SWAP]

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.