45Drives Knowledge Base
KB450086 - Setting ZFS ARC Limit on Linux
https://knowledgebase.45drives.com/kb/setting-zfs-on-linux-arc-limit/

KB450086 - Setting ZFS ARC Limit on Linux

Posted on November 19, 2018 by Rob MacQueen


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
  • 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.

There are no comments yet.

ZFS – 45Drives Knowledge Base
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

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 […]

Read more »

KB450206 – Adding Log Drives (ZIL) to ZFS Pool

Scope/Description This article details the process of adding a slog or log drive to your zpool. A log drive will log synchronous operations to the disk before it is written to the pool. ZIL/Log The ZFS Intent Log is a logging mechanism where all the of data to be written is stored, then later flushed […]

Read more »

KB450207 – Adding Cache Drives (L2ARC) to ZFS Pool

Scope/Description This article details the process of adding a L2ARC or cache drive to your zpool. L2ARC can be used to improve performance of random read loads on the system. L2ARC In a ZFS system a caching technique called ARC caches as much of your dataset in RAM as possible. This allows frequently data to […]

Read more »

KB450302 – Recovering ZFS Pool From Backup

Scope/Description This article will walk through the process of recovering a ZFS storage pool from a backup and re-enabling replication task afterwards Scenario: Initial setup of two servers, one “primary” and one “backup” primary -> 192.168.123.121 ZFS auto-replication setup between the two server such that “backup” is a copy of “primary” “primary” experiences massive failure […]

Read more »

KB450999 – Removing GELI Encryption from ZFS Pool

Scope/Description This article will show you how to remove GELI encryption from a ZFS pool while keeping the data. This does not require the GELI Key file but the pool must be unlocked prior (using the passphrase if you had created one. It is not necessary if you have not created a passphrase). When this […]

Read more »
© 2021 - 45Drives Knowledge Base
Unboxing Racking Storage Drives Cable Setup Power UPS Sizing Remote Access