I am currently using 16gb ram + zram + zswap (with 50gb dedicated swap partition) on an intel machine and would like to get opinion on the strategy to employ when adjust the configuration parameters for zram and zswap for optimal performance. Below are the available parameters for each:
-
zram
-
zswap
- compressor
- zpool
- max_pool_percent
- accept_threshold_percent
- same_filled_pages_enabled
- non_same_filled_pages_enabled
- shrinker_enabled
Am open to any other feedback pertaining to this. Heres how I currently get both zswap and zram setup:
{ config, pkgs, ... }:
{
systemd.services.zswap = {
description = "Enable ZSwap, set to LZ4 and Z3FOLD";
enable = true;
wantedBy = [ "basic.target" ];
path = [ pkgs.bash ];
serviceConfig = {
ExecStart = ''${pkgs.bash}/bin/bash -c 'cd /sys/module/zswap/parameters&& \
echo 1 > enabled&& \
echo 20 > max_pool_percent&& \
echo lz4 > compressor&& \
echo z3fold > zpool'
'';
Type = "oneshot";
};
};
zramSwap.enable = true;
}