What's in my ZFS ARC and L2ARC caches?

Solution 1:

Here's a script that's been updated to reflect the data in L2ARC.

See: http://blog.harschsystems.com/2010/09/08/arcstat-pl-updated-for-l2arc-statistics/

Source available here: https://github.com/mharsch/arcstat

Solution 2:

I would probably argue that you should care not about what's in the cache, but whether the most effective things have been cached. Ie, is the ARC cache being used to its maximum efficiency?

I run a small-scale (9TB) ZFS implementation at work and I find Ben Rockwood's tool arc_summary.pl, and Sun's arcstat.pl, both detailed in this cuddletech blog post, to be immensely useful.

I know it doesn't answer your question directly about what exactly is in the ARC cache, but these should give you some solid data about how your cache is being used, and whether you're in need of more memory/SSD space.