Improve L2ARC filling
Here is a ZFS patch which improves performance for workloads which need as much as (meta)data as possible in L2ARC.
I wrote it thinking about file servers which have no such "prefered" data and then need to be as fast as possible with all their metadata.
This patch modifies ZFS so that when it has to evict buffers from ARC, it first chooses buffers which are already in L2ARC.
In the best case, (meta)data is then loaded only once from disks, next times from L2ARC, which is what we want with this patch.
This patch introduces 2 new configuration options :
arc_evict_l2_first (0|1) : first evict buffers from ARC which are in L2ARC
arc_evict_l2_only (0|1) : only evict buffers from ARC which are in L2ARC
Here are some benchmarks using the following find loop :
for i in `seq 1 10`
ls -1 /zpool/ | while read dataset
time find /zpool/$dataset >/dev/null
And the following ZFS configuration :
We can see below that with the patch, ZFS is at its best as soon as it accesses the (meta)data for the second time (run 2), keeping the performance sustained over the time.
See PR in the next message.
Of course feel free to comment !