Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

zswap?

Featured Replies

I recently read about zswap and thought that it could work well on unraid and make swapping much faster on systems with high ram usage and many vms.

I tried to enable this feature in the syslinux.cfg but there were no signs of it working in syslog.

Also /sys/module/zswap seems to be nonexistent so that i think the unraid kernel is compiled without it.

 

Can I somehow install it or compile a custom kernel with it?

Does this feature even make sense on unraid?

 

Maybe this would work perfectly well. Any ideas?

  • Community Expert

UnRAID is designed to run completely from RAM without a swap file which is probably why the feature is not present.

  • 3 years later...

The beautiful thing about zswap is that is can compress unused portions


swap capability should ALWAYS be used for a linux type system...even if it is a compressed virtual version of itself

https://www.kernel.org/doc/html/v4.18/vm/zswap.html

https://haydenjames.io/linux-performance-almost-always-add-swap-space/

I really think it should be a thing that UnRAID utilizes, or at the very least give us the option to use it

https://www.linuxquestions.org/questions/slackware-14/requests-for-current-14-2-15-0-a-4175620463/page140.html#post5902241

 

Odd thing is...zramctl is included in the latest version of UnRAID (as of this posting Version: 6.8.3)

root@MOBIUS:/mnt/cache# zramctl --help

Usage:
 zramctl [options] <device>
 zramctl -r <device> [...]
 zramctl [options] -f | <device> -s <size>

Set up and control zram devices.

Options:
 -a, --algorithm lzo|lz4|lz4hc|deflate|842   compression algorithm to use
 -b, --bytes               print sizes in bytes rather than in human readable format
 -f, --find                find a free device
 -n, --noheadings          don't print headings
 -o, --output <list>       columns to use for status output
     --output-all          output all columns
     --raw                 use raw status output format
 -r, --reset               reset all specified devices
 -s, --size <size>         device size
 -t, --streams <number>    number of compression streams

 -h, --help                display this help
 -V, --version             display version

Available output columns:
        NAME  zram device name
    DISKSIZE  limit on the uncompressed amount of data
        DATA  uncompressed size of stored data
       COMPR  compressed size of stored data
   ALGORITHM  the selected compression algorithm
     STREAMS  number of concurrent compress operations
  ZERO-PAGES  empty pages with no allocated memory
       TOTAL  all memory including allocator fragmentation and metadata overhead
   MEM-LIMIT  memory limit used to store compressed data
    MEM-USED  memory zram have been consumed to store compressed data
    MIGRATED  number of objects migrated by compaction
  MOUNTPOINT  where the device is mounted

For more details see zramctl(8).

But the actual binary of zram is not included (possibly stripped out by the developers?)

root@MOBIUS:/mnt/cache# modprobe zram num_devices=4
modprobe: FATAL: Module zram not found in directory /lib/modules/4.19.107-Unraid

 

Edited by WarHawk8080

  • 1 year later...

I'm interested in ZRAM support in Unraid too.
I can't create a traditional swapfile because the cache pool (/mnt/cache) is backed by a btrfs RAID1 filesystem and that isn't supported.

 

root@unraid# modprobe zram
modprobe: FATAL: Module zram not found in directory /lib/modules/5.15.43-Unraid


but zramctl is installed...

root@unraid# zramctl -V
zramctl from util-linux 2.37.4


 

  • 3 months later...
On 9/22/2022 at 7:04 PM, ich777 said:

@WarHawk8080, @bjmi & @LolHens will be added in 6.11

 

It would be great if zstd compression is also supported:

# zramctl --find --size 8GiB -a zstd
zramctl: /dev/zram0: failed to set algorithm: Invalid argument

 

22 minutes ago, bjmi said:

It would be great if zstd compression is also supported:

It is, can you try to use lz4 instead of zstd for testing purposes?

 

EDIT: All compressions should work except for zstd, is it in your case needed?

40 minutes ago, ich777 said:

It is, can you try to use lz4 instead of zstd for testing purposes?

 

EDIT: All compressions should work except for zstd, is it in your case needed?

lz4 works fine.

# zramctl --find --size 8GiB -a lz4
/dev/zram0

But zstd emerges everywhere. Even zramctl --help mentions it

 <alg> specify algorithm, supported are:
   lzo, lz4, lz4hc, deflate, 842 and zstd
2 minutes ago, bjmi said:

But zstd emerges everywhere. Even zramctl --help mentions it

Only because the help section mentions it, it doesn't mean that it is also supported by the Kernel. ;)

 

Also don't forget that zramctl was included in Unraid but the module was missing, this was simply caused because zramctl is part of the util-linux package for Slackware and because Unraid strictly speaking doesn't use swap the module wasn't included

 

Is this compression algorithm needed or is this your preferred one? Just asking to determine if it is really needed.

A little more for you to read over here: Click and also over here: Click

 

From my opinion lz4 should be the sweet spot in terms of speed and compression.

22 hours ago, ich777 said:

Is this compression algorithm needed or is this your preferred one?

zstd is my preferred one. I can't prove which algorithm would fit best as it is highly dependent of the usage scenario.

 

22 hours ago, ich777 said:

From my opinion lz4 should be the sweet spot in terms of speed and compression.

As zstd isn't available out of the box, one can't make measurements easily.

 

I'm fine with lz4 for the moment as everything else work as expected and Yann Collet is the author of the both algs ;)

Thanks for your effort.

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.