It’s worthwhile understanding a couple of additional things in addition to @jro 's quick work with the calculator.
recordsize
is an upper bound.
Smaller files are stored in smaller records, so don’t think that putting recordsize=1M
on a dataset will mean that a hundred 10K files are suddenly going to pack themselves into a single large record.
“Overhead” is only part of the reason for the general recommendation for needing sufficient RAM to really benefit from L2ARC.
If your primary ARC is too small, then data can get pushed out of the tail-end before it’s really able to settle in and be “properly sorted” in a sense by the MFU and MRU algorithms. If you’ve only got 16G of RAM, but your active data set (ADS) is 128G, then while you may be able to, after several rounds of MFUG (ghost) hits, get your truly most important ~16G or so worth of data (if it gets a hypothetical “MFU index = 4” to stick) the rest of it will probably be getting pushed out of ARC and there won’t be enough time to sort between what deserves to be “MFU index = 3” vs what’s “MFU index = 2” and push the actual valuable data to L2ARC.
l2arc_mfuonly
is a likely valuable tunable that needs even more testing.
Having L2ARC not even investigate the MRU tail of ARC means that you’re less likely to have things like a backup job’s verify pass blow out both ARC and L2ARC. With L2ARC being a ring buffer as mentioned before, this is extra-penalizing because it’s harder/slower to populate it.
This is done with the ghost lists. Hit on something in the ghost list on the MFU side and it’ll re-read it and expand the balance towards MFU. Hit on an MRU ghost and it’ll do the same the other way.
I’ve recently rebooted my personal “home prod” unit so it’s still sitting at 50:50 MFU/MRU but I expect it to lean more strongly MFU once it’s full, because, well:
ARC states hits of all accesses:
Most frequently used (MFU): 99.5 % 1.2G
Most recently used (MRU): 0.5 % 6.0M
Most frequently used (MFU) ghost: 0.0 % 0
Most recently used (MRU) ghost: 0.0 % 0
Other L2ARC tuning like secondarycache=metadata
on datasets will of course also adjust the “minimum requirements” to make it usable. (An sVDEV would be faster but that’s not the purpose of this thread, and adds its own caveats.)
I believe I mentioned this in the last podcast, but:
I know one little company with a vested interest in OpenZFS becoming even more awesome that might be investigating this. 