openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.69k stars 1.75k forks source link

Allow pools to share a single l2arc cache #9859

Open adamdmoss opened 4 years ago

adamdmoss commented 4 years ago

Describe the problem you're observing

I have multiple pools of spinning disks with varying levels of activity over time, and a cache device on NVME.

The cache is quite effective - especially with https://github.com/zfsonlinux/zfs/pull/9582 - but manually partitioning the NVME into multiple independent caches is leaving some of the caches cold for long periods while other caches are struggling for space, which is far from ideal for performance/space/expense reasons.

It would be wonderful if multiple pools could point to the same cache device and have l2arc manage their relative needs.

behlendorf commented 4 years ago

While probably not impossible. Sharing an l2arc device in this fashion would be exceptionally difficult to implement since it requires associating a single device with multiple pools. This is something which is expressly prohibited by the design. Regardless, I've tagged this issue as a requested feature so it can be tracked.

richardelling commented 4 years ago

We did a design for this a few lives back. The arc.c changes are minor and relatively easy to implement and test. The hard part is managing a new spa type that does not include any data vdevs. Those changes are much more significant and impact many user-facing interfaces. We had the advantage of a restricted and highly automated user interface, so it was feasible for us. That said, it was a strange design decision to tie the cache devices to pools when ARC itself is shared amongst pools, except for cstor where each pool has its own ARC.

happycouak commented 3 years ago

Any update about this feature request ?

somebody-somewhere-over-the-rainbow commented 3 years ago

would also love to have this ... would be awesome!

shdw commented 2 years ago

Stumbled upon this while searching if this was possible to use the same L2ARC/ZLOG devices for distinct zfs pools. I also have servers that would benefit from this feature being implemented.

Not assiduously counting on it, but still thinking this would be a good idea.

Ranlvor commented 2 years ago

Pull-Request #14060 is about implementing this.

Jorsher commented 9 months ago

Interested in this. I see the PR appears to have stalled but hopefully gets picked back up. Would be great if L2ARC was similar to ARC and shared between all pools to maximize the benefit and use of capacity. Understood implementation is not as simple, but hope it gets there.