# ZFS L2Arc monitoring?



## Weaseal (Oct 12, 2012)

Hi all,
Does anyone know of a tool or commands available to monitor the status of the l2arc for a zpool?  I am specifically interested in knowing:

Is the l2arc 'warmed up' / ETA to warmed-up state
What files are cached?
Performance statistics (read/write comparisons)

Thanks!


----------



## phoenix (Oct 12, 2012)

"warmed up" simply means "data in cache".

There is no way to know what files are cached, as ZFS works at the block level, not the file level.  IOW, blocks are cached in the ARC/L2ARC, not "files".

Watch the output of `# zpool iostat -v 1` to see how many reads/writes are going to the cache.

Consider installing the sysutils/zfs-stats port as well, to get more detailed information regarding the ARC/L2ARC.


----------



## Weaseal (Oct 12, 2012)

Yikes!

```
$ zfs-stats -a
...
L2 ARC Breakdown:                               3.29m
        Hit Ratio:                      4.09%   134.41k
        Miss Ratio:                     95.91%  3.15m
        Feeds:                                  1.98m
```

96% misses??! That can't be good!! Any ideas on how I can determine what's causing this?

*Edit:* Full 'zfs-stats -a' output: http://pastebin.com/fEQueXBv


----------



## phoenix (Oct 13, 2012)

It appears your working set stays in the ARC, with hardly anything going out to the L2ARC.  Considering only 3 MB of data has been requested from the L2, and your ARC is sitting at only 6 GB out of 15 GB, you don't really need an L2.

At least, that's my understanding of the stats.


----------



## deepdish (Oct 13, 2012)

In comparison, here is an ZFS NAS with only 8GB of RAM with an L2ARC.

http://pastebin.com/1Qai62iQ


----------



## t1066 (Oct 13, 2012)

Warmup means filling up ARC for the first time after the system boots. Usually this will take a few hours to a day, depending on the filesystem load. 

Also, your ARC is very efficient. There are 125.55m hits and only 3.29m misses. All these misses will then go through L2ARC. You may try to improve the efficiency of the L2ARC by setting vfs.zfs.l2arc_noprefetch=0.


----------

