I am running 3 pools. 1 pool has spinners, it is backed by a metadata only L2ARC of 13.41 GiB. I have 64GB RAM, with typical system load I have a 32GB ARC. Just the HDD pool alone has a metadata size of 11.5Gib (and Psize 3.5G), this is with a 1M record size. If I run multiple queries including complex directory traversal on the SSDs some of the metadata in ARC gets evicted and reloaded from L2ARC. My metadata only L2ARC is as below:
L2ARC size (adaptive): 31.5 GiB
Compressed: 26.8 % 8.4 GiB
Header size: 0.4 % 135.9 MiB
MFU allocated size: 11.0 % 945.8 MiB
MRU allocated size: 125.4 % 10.6 GiB
Prefetch allocated size: 0.3 % 29.4 MiB
Data (buffer content) allocated size: 0.0 % 0 Bytes
Metadata (buffer content) allocated size: 136.7 % 11.5 GiB
This results in fairly rare hits, but improves folder browsing performance a little. 6.5 % hit ratio, but a paltry 4.1Gib read.
Then I changed L2ARC to store all metadata, and also only data MFU.
In GUI System > sysctl I set type:ZFS, Variable:l2arc_mfuonly, Value 2
sudo zfs set secondarycache=all main
This resulted in:
- A huge increase in write to the drive. Peaks around 200Mb/s (ongoing after hydration), mean 2 MiB/s, vs 3 KiB/s with metadata only.
- Read speed averaging about 2% the backed array reads when running normal operations.
- Read speed averaging about 6-10% the backed array reads when running operations ennumerating a lot of files. I think this is more meaningful than total hits as folder navigation was A1155’s problem.
- An impression of quieter drives, suggesting in practice this is doing a good job of absorbing additional random reads beyond ARC.
- Folder navigation not appreciably slower, possibly faster.
My vague thoughts after having a play:
MFU data + metadata L2ARC has been supported since about EE 24.10. It offers an alternative to MFU only or metadata only L2ARC. Even on a very small drive, it outperforms a metadata only L2ARC, at the expense of much heavier writes. It is possible the write volume would be reduced with a larger disk, as rewriting evicted data is presumably occurring. For WORM datasets this may allow larger lower endurance SSDs to be viable for L2ARC, and the data MFU is a fraction of MRU (and by extension a fraction of total evicted data) - Not shown, but my overall ARC is a 20/80 (MFU/MRU) ratio for L2 eligible evictions.
Of course this doesn’t address all cases, nor some of the other points made in this thread. But it is an existing feature which may address A1155’s problem.
After the new settings have had time to settle I will edit this post to update. I had to reboot for unrelated reasons so my current data reflects restarting services rather than usual running.
Update: I let it run at MFU + metadata only cache for a few days (below). It is backing 18TB, of which about 6TB is likely to be hit. Writes have just become smaller than reads, and L2 reads are about 40% of the array’s total reads. Navigation and overall responsiveness is a little better than with a 16GB drive, but the directory traversal and retrieval of thumbnails not seen for a while is noticeably more consistent (and the array quieter during these actions). The total metadata loaded in is surprisingly small. Not shown is the increased writes to small MFU+metadata L2ARC vs metadata only, which is nontrival for small drives. At 1.5TB I have started getting low memory aborts. So in conclusion: It depends, but a MFU+metadata L2ARC should be considered as an alternative to metadata only, but you need to tolerate increased writes.
L2ARC size (adaptive): 1.5 TiB
Compressed: 99.8 % 1.5 TiB
Header size: < 0.1 % 146.7 MiB
MFU allocated size: 80.5 % 1.2 TiB
MRU allocated size: 8.8 % 138.8 GiB
Prefetch allocated size: 10.7 % 169.1 GiB
Data (buffer content) allocated size: 100.0 % 1.5 TiB
Metadata (buffer content) allocated size: < 0.1 % 703.2 MiB
Update2: The TN GUI gets a Massive Sad if you disconnect 1.5TB of cache from an array under moderate load.