Analyze cache content

Hi Forum,
I want to swap a cache VDEV SSD with one of lower capacity. With zpool iostat -v I see an allocation of about 60%:

# zpool iostat -v                  
                                            capacity     operations     bandwidth 
pool                                      alloc   free   read  write   read  write
----------------------------------------  -----  -----  -----  -----  -----  -----
boot-pool                                 5.56G   112G      0      1  9.74K  14.3K
  nvme1n1p3                               5.56G   112G      0      1  9.74K  14.3K
----------------------------------------  -----  -----  -----  -----  -----  -----
data                                      9.29T  12.5T    106    260  23.6M  21.3M
  raidz2-0                                9.29T  12.5T    106    260  23.6M  21.3M
    aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee      -      -     21     56  3.94M  3.55M
    aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee      -      -     21     48  3.96M  3.55M
    aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee      -      -     17     41  3.91M  3.55M
    aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee      -      -     12     32  3.94M  3.55M
    aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee      -      -     19     44  3.93M  3.55M
    aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee      -      -     14     35  3.88M  3.55M
cache                                         -      -      -      -      -      -
  aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee    1.02T   815G      4     49   592K  6.73M
----------------------------------------  -----  -----  -----  -----  -----  -----

Is there a way to get details about the content, especially: aging and usage (hit rate) of cached data?

Many thanks,
Frank

Well, the extreme list is:
arc_summary
but that spews out lots of stuff.

Probably want these numbers, (from my desktop that does not have a L2ARC / Cache device):

ARC misc:
...
        L2 cached evictions:                                     0 Bytes
        L2 eligible evictions:                                  16.9 GiB
        L2 eligible MFU evictions:                     12.9 %    2.2 GiB
        L2 eligible MRU evictions:                     87.1 %   14.7 GiB
        L2 ineligible evictions:                               144.1 MiB

And these tunables:

Tunables:
...
        l2arc_exclude_special                                          0
        l2arc_feed_again                                               1
        l2arc_feed_min_ms                                            200
        l2arc_feed_secs                                                1
        l2arc_headroom                                                 8
        l2arc_headroom_boost                                         200
        l2arc_meta_percent                                            33
        l2arc_mfuonly                                                  0
        l2arc_noprefetch                                               1
        l2arc_norw                                                     0
        l2arc_rebuild_blocks_min_l2size                       1073741824
        l2arc_rebuild_enabled                                          1
        l2arc_trim_ahead                                               0
        l2arc_write_boost                                       33554432
        l2arc_write_max                                         33554432

Last, developers have been working on the L2ARC / Cache software a bit. Some of the more recent changes may help cache more information. See this thread, (which unfortunately goes off topic a few times);

Many thanks, this helps already!

1 Like