# ZFS Arc Max on Linux

Check stats with `arcstat.py`

```shell
# arcstat.py -h
Usage: arcstat.py [-hvx] [-f fields] [-o file] [-s string] [interval [count]]

     -h : Print this help message
     -v : List all possible field headers and definitions
     -x : Print extended stats
     -f : Specify specific fields to print (see -v)
     -o : Redirect output to the specified file
     -s : Override default field separator with custom character or string

Examples:
    arcstat.py -o /tmp/a.log 2 10
    arcstat.py -s "," -o /tmp/a.log 2 10
    arcstat.py -v
    arcstat.py -f time,hit%,dh%,ph%,mh% 1
```

Set arc max in `/etc/modprobe.d/zfs.conf`, defaults to 50% memory.

For example, 48GiB:

```shell
echo "options zfs zfs_arc_max=51539607552" > /etc/modprobe.d/zfs.conf
```

Rebuild kernel, then reboot.

```shell
mkinitcpio -p linux
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ramsdenj.com/johns-notes-and-documentation/introduction/introduction-2/zfs_arc_max.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
