Linux Disk Cache (maybe ZFS)

Hi there,

I am running Archlinux with a couple of HDDs in a ZFS RAID and i want to use 1-2 ssds as a cache.I will primarly store qcow images on there. I noticed that l2arc is not persistant between reboots. The patch i found (https://www.illumos.org/issues/3525) is nearly five years old and wasnt merged into upstream. So i have low confidence that it will be merged in the near future. So i will probably end ZFS for me soon.
I am probably not the first one to think about a setup like this and i read about LVM caching here: https://rwmj.wordpress.com/2014/05/22/using-lvms-new-cache-feature/. https://www.redhat.com/en/blog/improving-read-performance-dm-cache says that it does not get cleared after a reboot. I want to hear some opinions about what i am trying to do and about experiences you had with setups like this or even new ideas.

Thanks and have a great day.

I am sure persistent L2Arc is coming, but yeah, might take a while longer.

In the mean time I still use ZFS in my system, with four spinning rust in a striped mirror for data, and a separate pool of SSD’s in a striped mirror for games

What are your speeds for reading/writing? I got 2 drives striped which do 160mb/s on their own. The striped image in windows does about 15-40. i do have enough ram with 32gb.

To be fair, I haven’t done any speed tests

1 Like

Caching this may not be what you want to do. Cache is supposed to be for either the most recently used stuff or the most frequently used stuff. I think ZFS ARC does a mix of both. Things in cache are supposed to be dynamic; stuff moves in and out. If you know you only want the VM images on the SSDs, you will probably be better off making another zpool out of just the SSDs.

If you have 240 GB SSDs but you know you will only have 120 GB, you make wanna look into partitioning the drives and having the cache on half of the drive, but that’s probably a bad idea for performance reasons.

l2arc caches parts of images. not just whole files. and it does boost speeds.