Did you know  45Drives offers free  public and private  webinars ? Click here to learn more  & register! Build & Price

KB450086 – Setting ZFS ARC Limit on Linux

You are here:

Scope/Description

  • ZFS on Linux defaults to use only 50% of available RAM in the system.
  • This should be bumped up to 80% in a sole ZFS server, and 70% if other tasks (non ZFS) are running as well.
  • Here is a website to convert bytes to gigabytes, as the inputted value needs to be in bytes.

Prerequisites

  • Linux Server with ZFS 0.8.3 Installed

Steps

  • To check the amount of RAM dedicated to the ARC limit currently run the following command, c_min and c_max are the min and max values set for the ARC limit.
cat /proc/spl/kstat/zfs/arcstats |grep c_
  • Create a ZFS conf file.
vim /etc/modprobe.d/zfs.conf
  • Add the following options to the zfs.conf, change the values depending on the use case/amount of RAM in the system. In the example below we have 128GB of RAM and we set it to 33% and 80% of our RAM. This is done in byte size
options zfs zfs_arc_min=45354854646
options zfs zfs_arc_max=109951162778
  • Once that is done, you must run the following command to generate a new initramfs image.
sudo update-initramfs -u -k all

or if on Rocky Linux:

dracut --regenerate-all -f
  • Make sure to reboot the system for the changes to take effect

Verification

  • To verify the limits were set, after the reboot run the original command to confirm the values have changed.

cat /proc/spl/kstat/zfs/arcstats |grep c_

  • Or you could run the following command to see as well:
cat /sys/module/zfs/parameters/zfs_arc_min
cat /sys/module/zfs/parameters/zfs_arc_max

Troubleshooting

  • If you want to set the value to a specific amount of any percentage of the ram change the max value set.
Was this article helpful?
Dislike 2
Views: 4149
Unboxing Racking Storage Drives Cable Setup Power UPS Sizing Remote Access