L2Arc is usually configured to cache random spinning platter reads on an SSD. I've set up this configuration in the hopes of speeding up directory traversal.
This is the setup:
# zpool list -v
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
geek1 2.72T 1.18T 1.54T - 53% 43% 4.64x ONLINE -
sdc 1.36T 606G 786G - 54% 43%
sdd 1.36T 606G 786G - 53% 43%
log - - - - - -
zil 3.97G 0 3.97G - 0% 0%
cache - - - - - -
l2arc 32.0G 4.24G 27.8G - 0% 13%
The machine has 20GB of memory: plenty for Arc.
I would expect a find
call over the filesystem to be sped up a lot. It is sped up by a factor of 5, but in absolute terms it's still slow. It takes 3.4 hours to list 46M files.
# while true; do time find /geek1/ -type f|wc -l; done
46774149
real 1103m18.661s
user 2m15.143s
sys 5m52.096s
46774149
real 243m0.289s
user 2m3.063s
sys 5m7.107s
46774149
real 205m23.922s
user 2m7.566s
sys 6m32.638s
How can directory traversal be made more efficient?
zpool get all
prints:
NAME PROPERTY VALUE SOURCE
geek1 size 2.72T -
geek1 capacity 43% -
geek1 altroot - default
geek1 health ONLINE -
geek1 guid default
geek1 version - default
geek1 bootfs - default
geek1 delegation on default
geek1 autoreplace off default
geek1 cachefile - default
geek1 failmode wait default
geek1 listsnapshots off default
geek1 autoexpand off default
geek1 dedupditto 0 default
geek1 dedupratio 4.64x -
geek1 free 1.54T -
geek1 allocated 1.18T -
geek1 readonly off -
geek1 ashift 0 default
geek1 comment - default
geek1 expandsize - -
geek1 freeing 0 default
geek1 fragmentation 53% -
geek1 leaked 0 default
geek1 feature@async_destroy enabled local
geek1 feature@empty_bpobj active local
geek1 feature@lz4_compress active local
geek1 feature@spacemap_histogram active local
geek1 feature@enabled_txg active local
geek1 feature@hole_birth active local
geek1 feature@extensible_dataset enabled local
geek1 feature@embedded_data active local
geek1 feature@bookmarks enabled local
geek1 feature@filesystem_limits enabled local
geek1 feature@large_blocks enabled local