brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: limit ZFS memory with zfs_arc_max when containers need the RAM

Memory
~/tips/tip-unraid-zfs-arc-max

awk '/^size|^c_max/ {printf "%s %.1f GiB\n", $1, $3/1073741824}' /proc/spl/kstat/zfs/arcstats

The Unraid setting that caps how much memory ZFS keeps as cache.

ZFS keeps recently read data in memory, a cache called the ARC. That is good for speed and surprising when the Dashboard shows little free memory.

Under Settings, Disk Settings the field Tunable (zfs_arc_max) sets the ceiling. It offers sizes as a share of your memory.

If you run virtual machines or heavy containers next to ZFS pools, choose a smaller share so they can get memory when they need it. If the server mainly serves files from ZFS, a larger one helps.

Check what the ARC is using right now:

awk '/^size|^c_max/ {printf "%s %.1f GiB\n", $1, $3/1073741824}' /proc/spl/kstat/zfs/arcstats

Without any ZFS pool or ZFS disk, this setting has no effect worth chasing.

Further reading: Unraid docs: file systems

More Memory tips lsmem --summary for f in /proc/[0-9]*/status; do sudo apt install smem sudo pmap -x 1234 sudo systemctl edit indexer.service All Memory tips (12) All topics

Link