Skip to content

Commit 022bf86

Browse files
shodanshoktonyhutter
authored andcommitted
Increase L2ARC write rate and headroom
Current L2ARC write rate and headroom parameters are very conservative: l2arc_write_max=8M and l2arc_headroom=2 (ie: a full L2ARC writes at 8 MB/s, scanning 16/32 MB of ARC tail each time; a warming L2ARC runs at 2x these rates). These values were selected 15+ years ago based on then-current SSDs size, performance and endurance. Today we have multi-TB, fast and cheap SSDs which can sustain much higher read/write rates. For this reason, this patch increases l2arc_write_max to 32M and l2arc_headroom to 8 (4x increase for both). Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Gionatan Danti <[email protected]> Closes openzfs#15457
1 parent 05aeaca commit 022bf86

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

man/man4/zfs.4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ and only applicable in related situations.
9898
.It Sy l2arc_feed_secs Ns = Ns Sy 1 Pq u64
9999
Seconds between L2ARC writing.
100100
.
101-
.It Sy l2arc_headroom Ns = Ns Sy 2 Pq u64
101+
.It Sy l2arc_headroom Ns = Ns Sy 8 Pq u64
102102
How far through the ARC lists to search for L2ARC cacheable content,
103103
expressed as a multiplier of
104104
.Sy l2arc_write_max .
@@ -207,12 +207,12 @@ to enable caching/reading prefetches to/from L2ARC.
207207
.It Sy l2arc_norw Ns = Ns Sy 0 Ns | Ns 1 Pq int
208208
No reads during writes.
209209
.
210-
.It Sy l2arc_write_boost Ns = Ns Sy 8388608 Ns B Po 8 MiB Pc Pq u64
210+
.It Sy l2arc_write_boost Ns = Ns Sy 33554432 Ns B Po 32 MiB Pc Pq u64
211211
Cold L2ARC devices will have
212212
.Sy l2arc_write_max
213213
increased by this amount while they remain cold.
214214
.
215-
.It Sy l2arc_write_max Ns = Ns Sy 8388608 Ns B Po 8 MiB Pc Pq u64
215+
.It Sy l2arc_write_max Ns = Ns Sy 33554432 Ns B Po 32 MiB Pc Pq u64
216216
Max write bytes per interval.
217217
.
218218
.It Sy l2arc_rebuild_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int

module/zfs/arc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,8 +776,8 @@ uint64_t zfs_crc64_table[256];
776776
* Level 2 ARC
777777
*/
778778

779-
#define L2ARC_WRITE_SIZE (8 * 1024 * 1024) /* initial write max */
780-
#define L2ARC_HEADROOM 2 /* num of writes */
779+
#define L2ARC_WRITE_SIZE (32 * 1024 * 1024) /* initial write max */
780+
#define L2ARC_HEADROOM 8 /* num of writes */
781781

782782
/*
783783
* If we discover during ARC scan any buffers to be compressed, we boost

0 commit comments

Comments
 (0)