Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable "small file" data to be excluded from L2ARC #11761

Closed
pashford opened this issue Mar 16, 2021 · 1 comment · Fixed by #12285
Closed

Enable "small file" data to be excluded from L2ARC #11761

pashford opened this issue Mar 16, 2021 · 1 comment · Fixed by #12285
Labels
Type: Feature Feature request or new feature

Comments

@pashford
Copy link
Contributor

Describe the feature would like to see added to OpenZFS

I believe it would be useful to have a per-pool flag to disable placing data residing in a Small File VDEV into the L2ARC.

How will this feature improve OpenZFS?

The use case for this feature is when both L2ARC and Small Files are kept on SSDs of a similar performance. Under these circumstances, the time to get the data from L2ARC is similar to the time to get the data from the Small File VDEV. By not allowing Small File data into the L2ARC, it becomes more able to cache data from spinning disk.

In addition, the L2ARC segment size will be more consistent. By removing the smallest files from consideration for L2ARC, the average block size will increase, causing less memory to be used for L2ARC headers.

@pashford pashford added the Type: Feature Feature request or new feature label Mar 16, 2021
@behlendorf
Copy link
Contributor

This was actually a change we discussed making to the default behavior in the original implementation. It looks like it was never included in the finalized version, however I think it's still a good idea. Specifically, any block which is stored on a dedicated "special allocation class" vdev should not be written to the L2ARC.

For anyone interested in picking up this work it looks pretty straight forward. We'd want to update the DBUF_IS_L2CACHEABLE macro so it considers these dbufs to be non-l2arc cacheable. This will prevent them from ever being written to the L2ARC. The blkptr is available in the dbuf and can be used to determine where it's stored in the pool. One option we discussed was adding a new value to the "secondarycache" property to control this. However, it seems like this would always be a good idea as long as we can assume the special vdevs are roughly the same performance as the L2ARC vdev.

behlendorf pushed a commit that referenced this issue Nov 11, 2021
Special allocation class or dedup vdevs may have roughly the same
performance as L2ARC vdevs. Introduce a new tunable to exclude those
buffers from being cacheable on L2ARC.

Reviewed-by: Don Brady <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: George Amanakis <[email protected]>
Closes #11761 
Closes #12285
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Sep 15, 2022
Special allocation class or dedup vdevs may have roughly the same
performance as L2ARC vdevs. Introduce a new tunable to exclude those
buffers from being cacheable on L2ARC.

Reviewed-by: Don Brady <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: George Amanakis <[email protected]>
Closes openzfs#11761
Closes openzfs#12285
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Feature request or new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants