ZFS L2ARC monitoring scripts

Here are some scripts that can be used to monitor the secondary cache of ZFS: L2ARC.

L2ARC is usually set up as one or more SSDs.

The script has a quite heavy dependency of ROOT (the data analysis framework, not the privilege level or the plant's organ). The script only works on Linux.

The package contains:

  1. arc-cmd.sh, which is a data logger that writes to /tmp/arcstats.txt.

  2. ArcPlot.py, which displays a live graph of four variables, and saves a PDF file when it exits

Installation:

Usage:

    1. l2_hits: number of times data was served from the L2ARC

    2. l2_misses: number of times data was not in the ARC (memory cache) or L2ARC, but had to be read from the main pool instead. Comparing hits and misses can be misleading if the vertical scale is different. Remember to look at the units on the axis before drawing conclusions.

    3. l2_write_bytes: Number of bytes written to the cache device. Note: the vertical axis will have “x 106 or x 109 next to it, which means that you should multiply the number with a million and a billion, respectively. It's not exactly the same as MB and GB, it's the kind of GB that hard drive manufacturers use.

    4. l2_size: Size in bytes of the cached data (not sure about the exact definition)

    5. size: Size of the ARC. This is not directly related to the L2ARC, but it's included because it's useful.

Note: This script is very primitive and I wanted to make it better, but then I wouldn't have time to finish it.

Contact: Marius Bjornstad <pmb@fa2k.net>

Also see http://zfsonlinux.org

Screenshot: