Skip to content

Commit 48d3f7f

Browse files
ixhamzabehlendorf
authored andcommitted
man: Update L2ARC tunables for DWPD and parallel writes
Add l2arc_dwpd_limit, remove l2arc_write_boost, update related tunables. Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ameer Hamza <ahamza@ixsystems.com> Closes #18093
1 parent d1f290f commit 48d3f7f

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

man/man4/zfs.4

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ Seconds between L2ARC writing.
109109
.
110110
.It Sy l2arc_headroom Ns = Ns Sy 8 Pq u64
111111
How far through the ARC lists to search for L2ARC cacheable content,
112-
expressed as a multiplier of
113-
.Sy l2arc_write_max .
112+
expressed as a multiplier of the effective write size.
114113
ARC persistence across reboots can be achieved with persistent L2ARC
115114
by setting this parameter to
116115
.Sy 0 ,
@@ -125,6 +124,19 @@ A value of
125124
.Sy 100
126125
disables this feature.
127126
.
127+
.It Sy l2arc_dwpd_limit Ns = Ns Sy 100 Pq uint
128+
Drive Writes Per Day limit for L2ARC devices to protect SSD endurance,
129+
specified as a percentage where 100 equals 1.0 DWPD.
130+
A value of 100 means each L2ARC device can write its own capacity once per day.
131+
Lower values support fractional DWPD
132+
(50 = 0.5 DWPD, 30 = 0.3 DWPD for QLC SSDs).
133+
Higher values allow more writes (300 = 3.0 DWPD).
134+
The effective write rate is always bounded by
135+
.Sy l2arc_write_max .
136+
A value of 0 disables DWPD rate limiting entirely.
137+
DWPD limiting only applies after the initial fill pass completes and when
138+
total L2ARC capacity is at least twice arc_c_max.
139+
.
128140
.It Sy l2arc_exclude_special Ns = Ns Sy 0 Ns | Ns 1 Pq int
129141
Controls whether buffers present on special vdevs are eligible for caching
130142
into L2ARC.
@@ -179,9 +191,8 @@ can render it slow or unusable.
179191
This parameter limits L2ARC writes and rebuilds to achieve the target.
180192
.
181193
.It Sy l2arc_trim_ahead Ns = Ns Sy 0 Ns % Pq u64
182-
Trims ahead of the current write size
183-
.Pq Sy l2arc_write_max
184-
on L2ARC devices by this percentage of write size if we have filled the device.
194+
Trims ahead of the current write size on L2ARC devices by this percentage
195+
of write size if we have filled the device.
185196
If set to
186197
.Sy 100
187198
we TRIM twice the space required to accommodate upcoming writes.
@@ -216,13 +227,12 @@ to enable caching/reading prefetches to/from L2ARC.
216227
.It Sy l2arc_norw Ns = Ns Sy 0 Ns | Ns 1 Pq int
217228
No reads during writes.
218229
.
219-
.It Sy l2arc_write_boost Ns = Ns Sy 33554432 Ns B Po 32 MiB Pc Pq u64
220-
Cold L2ARC devices will have
221-
.Sy l2arc_write_max
222-
increased by this amount while they remain cold.
223-
.
224230
.It Sy l2arc_write_max Ns = Ns Sy 33554432 Ns B Po 32 MiB Pc Pq u64
225-
Max write bytes per interval.
231+
Maximum write rate in bytes per second for each L2ARC device.
232+
Used directly during initial fill, when DWPD limiting is disabled,
233+
or for non-persistent L2ARC.
234+
When DWPD limiting is active, writes are capped by this rate.
235+
Total L2ARC throughput scales with the number of cache devices in a pool.
226236
.
227237
.It Sy l2arc_rebuild_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
228238
Rebuild the L2ARC when importing a pool (persistent L2ARC).

man/man7/zpoolconcepts.7

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,24 @@ This can be changed with
426426
The cache device header
427427
.Pq Em 512 B
428428
is updated even if no metadata structures are written.
429+
.Pp
430+
L2ARC operates in one of two modes depending on total cache capacity.
431+
When total L2ARC capacity is less than twice
432+
.Sy arc_c_max ,
433+
L2ARC uses exclusive caching,
434+
writing buffers to cache as they are evicted from ARC.
435+
When total capacity is at least twice
436+
.Sy arc_c_max ,
437+
L2ARC switches to inclusive caching with persistent markers
438+
that track scan positions,
439+
attempting to duplicate ARC contents as much as write throughput allows.
429440
Setting
430441
.Sy l2arc_headroom Ns = Ns Sy 0
431442
will result in scanning the full-length ARC lists for cacheable content to be
432443
written in L2ARC (persistent ARC).
444+
In inclusive mode, markers progress toward the head across iterations,
445+
naturally covering the full list.
446+
.Pp
433447
If a cache device is added with
434448
.Nm zpool Cm add ,
435449
its label and header will be overwritten and its contents will not be

0 commit comments

Comments
 (0)