вот так у себя ограничиваю аппетиты zfs arc cache
[ -f /etc/modprobe.d/zfs.conf.orig ] && cp -fv /etc/modprobe.d/zfs.conf{,.orig}
if command -v zfs >/dev/null 2>&1; then
RAM_SIZE_GB=$(( $(awk '/^MemTotal/{print $2}' /proc/meminfo) / 1024 / 1000))
if [[ RAM_SIZE_GB -lt 16 ]] ; then
# 1GB/1GB
MY_ZFS_ARC_MIN=1073741824
MY_ZFS_ARC_MAX=1073741824
else
MY_ZFS_ARC_MIN=$((RAM_SIZE_GB * 1073741824 / 16))
MY_ZFS_ARC_MAX=$((RAM_SIZE_GB * 1073741824 / 8))
fi
# Enforce the minimum, incase of a faulty vmstat
if [[ MY_ZFS_ARC_MIN -lt 1073741824 ]] ; then
MY_ZFS_ARC_MIN=1073741824
fi
if [[ MY_ZFS_ARC_MAX -lt 1073741824 ]] ; then
MY_ZFS_ARC_MAX=1073741824
fi
cat <<EOF > /etc/modprobe.d/zfs.conf
#
eXtremeSHOK.com ZFS tuning
https://github.com/extremeshok/xshok-proxmox# Use 1/16 RAM for MAX cache, 1/8 RAM for MIN cache, or 1GB
options zfs zfs_arc_min=${MY_ZFS_ARC_MIN}
options zfs zfs_arc_max=${MY_ZFS_ARC_MAX}
# Use the prefetch method
options zfs l2arc_noprefetch=0
# Dont read data from the l2 cache while writing to it
options zfs l2arc_norw=0
# Max write speed to l2arc
# tradeoff between write/read and durability of SSD
# default : 8 * 1024 * 1024
# NVMe SSD: 3000 * 1024 * 1024
# setting here : 500 * 1024 * 1024
options zfs l2arc_write_max=524288000
# Write limit for the l2 feeder directly after boot (before the first arc eviction happend)
# NVMe SSD: 3000 * 1024 * 1024
options zfs l2arc_write_boost=524288000
options zfs zfs_txg_timeout=60
EOF
echo
cat /etc/modprobe.d/zfs.conf
fi
update-initramfs -u -v -k all