Stop ZFS from eating your RAM before the OOM killer does

Filesystem & Storage (ZFS/Btrfs/LVM)

Stop ZFS from eating your RAM before the OOM killer does

Technical Briefing | 12/2/2026

You probably installed ZFS because it sounded bulletproof. It is, until it isn’t. The adaptive replacement cache is designed to be smart, but on a busy node, it often refuses to release memory quickly enough when your primary application starts a heavy batch job. I have seen countless production boxes hit the kernel OOM killer simply because the ARC thought it could keep holding onto cached metadata while the rest of the stack was gasping for air.

Why the ARC defaults lie to you

By default, ZFS will try to consume half of your total system RAM. That sounds reasonable in a whitepaper, but in the real world, your kernel and application memory needs are rarely static. When your monitoring starts alerting on memory pressure, the ARC should shrink. Often, it just sits there, pinned, while your database latency spikes through the roof. It’s time to put a hard cap on it.

echo 8589934592 > /sys/module/zfs/parameters/zfs_arc_max

  • Set zfs_arc_max in /etc/modprobe.d/zfs.conf to make the change stick across reboots
  • Target 25-30 percent of total RAM if you run heavy Java or database workloads
  • Use zfs-stats -a to monitor how much of your cache is actual data versus metadata

If you don’t constrain the ARC, you’re essentially betting that your apps will never have a sudden spike in demand. They always do. Spend five minutes tuning this today, and you won’t have to explain to your manager why the production database crashed at 3 AM because of a cache policy nobody asked for.

Linux Admin Automation  |  © www.ngelinux.com  |  12/2/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted