LolHens Posted April 7, 2017 Share Posted April 7, 2017 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? Quote Link to comment
itimpi Posted April 7, 2017 Share Posted April 7, 2017 UnRAID is designed to run completely from RAM without a swap file which is probably why the feature is not present. Quote Link to comment
WarHawk8080 Posted June 16, 2020 Share Posted June 16, 2020 (edited) 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 June 16, 2020 by WarHawk8080 Quote Link to comment
bjmi Posted May 31, 2022 Share Posted May 31, 2022 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 Quote Link to comment
ich777 Posted September 22, 2022 Share Posted September 22, 2022 @WarHawk8080, @bjmi & @LolHens will be added in 6.11 1 Quote Link to comment
bjmi Posted September 27, 2022 Share Posted September 27, 2022 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 Quote Link to comment
ich777 Posted September 27, 2022 Share Posted September 27, 2022 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? Quote Link to comment
bjmi Posted September 27, 2022 Share Posted September 27, 2022 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 Quote Link to comment
ich777 Posted September 27, 2022 Share Posted September 27, 2022 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. Quote Link to comment
bjmi Posted September 28, 2022 Share Posted September 28, 2022 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. 1 Quote Link to comment
ich777 Posted October 7, 2022 Share Posted October 7, 2022 @bjmi in case you haven't seen it already: (ZSTD compression is now available with 6.11.1) 2 Quote Link to comment
Recommended Posts
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.