ZFS ARC cap configuration on Proxmox VE with undefined VM memory headroom
0 reputation · 10 Nov 2021, 18:48 UTC
0 reputation · 10 Nov 2021, 18:48 UTC
Proxmox VE hosts using ZFS for storage rely on the Adaptive Replacement Cache for read caching. By default ARC can consume a large share of host RAM, which creates tension with memory allocated to VMs and containers. The goal is to select an ARC limit that preserves guest memory availability while retaining ZFS read performance.
There is no single documented correct cap. The appropriate value depends on workload read patterns, total RAM, and acceptable hit ratio. ARC pressure is observable via kernel statistics, but translating those observations into a safe persistent limit involves a workload-specific trade-off. Default sizing behavior also varies with the OpenZFS version shipped with Proxmox VE releases.
What measurement indicates ARC is the primary memory bottleneck for VMs rather than another subsystem? How should an acceptable ARC hit ratio be balanced against guaranteed VM memory headroom? What is the documented permission boundary for changing the ARC maximum on a production Proxmox VE host?
35275 reputation · 10 Nov 2021, 23:31 UTC
Use arcstat and /proc/spl/kstat/zfs/arcstats to see the current ARC size, hit and miss counts. The key indicators are:
free -m) is low (e.g. < 10 % of total RAM).free -m shows guest swap usage, the bottleneck is the guest over‑commit, not ARC.If all three conditions hold, ARC is the primary memory pressure source for your VMs.
The ARC hit‑ratio is available in arcstat as hit vs miss. A high ratio (e.g. > 95 %) means most reads are served from RAM, but it also means the ARC consumes more memory.
Practical guidance for Proxmox hosts:
zfs_arc_max to 16 GB (0.25 × 64 GB).arcstat and guest performance, and iterate until you hit the sweet spot.cat /sys/module/zfs/parameters/zfs_arc_max. The output is in bytes.echo "options zfs zfs_arc_max=17179869184" | sudo tee /etc/modprobe.d/zfs.conf
Replace 17179869184 with the desired byte value.
sudo update-initramfs -u
sudo reboot.cat /sys/module/zfs/parameters/zfs_arc_max
arcstat to confirm the hit‑ratio and free memory behaviour.Runtime adjustment without reboot is possible on many OpenZFS versions via /sys/module/zfs/parameters/zfs_arc_max, but the change will be lost on reboot unless the modprobe.d file is updated.
Do your VMs currently use host swap or ballooning? If they are swapping or ballooning heavily, the host memory pressure is coming from the guests, not ARC, and you should consider increasing guest RAM or reducing over‑commit rather than tightening the ARC cap.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.