Skip to main content

The thing that quietly eats your RAM: ZFS ARC

There's a second tenant on the host besides the VMs: ZFS. ZFS uses a chunk of RAM as a read cache called the ARC (Adaptive Replacement Cache), and by default it will happily grow to use up to half (or more) of the machine's memory.

That's fine on a dedicated storage box. On a host that's also packing in VMs, an uncapped ARC is a hidden roommate eating the budget you wanted for guests. When this lab started filling up, the ARC was effectively uncapped.

The fix is to give ARC a fixed ceiling so the VM budget is predictable:

# /etc/modprobe.d/zfs.conf
options zfs zfs_arc_max=<bytes>

I capped it (first to 16 GiB, later trimmed to 12 GiB when more VMs needed the room) and applied it live as well as persisting it. ARC is reclaimable — it'll shrink under pressure — but on a swapless host you don't want to rely on "it'll shrink in time." A hard cap turns a fuzzy, dynamic consumer into a known constant you can plan around.

Lesson learned: before you size VMs on a ZFS host, find out what ARC is allowed to take. An uncapped ARC is the single most common reason "the numbers added up but the host is still tight." Cap it, then do your VM math against what's left.