]> git.proxmox.com Git - mirror_zfs.git/blame - man/man5/zfs-module-parameters.5
Support accessing .zfs/snapshot via NFS
[mirror_zfs.git] / man / man5 / zfs-module-parameters.5
CommitLineData
29714574
TF
1'\" te
2.\" Copyright (c) 2013 by Turbo Fredriksson <turbo@bayour.com>. All rights reserved.
3.\" The contents of this file are subject to the terms of the Common Development
4.\" and Distribution License (the "License"). You may not use this file except
5.\" in compliance with the License. You can obtain a copy of the license at
6.\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
7.\"
8.\" See the License for the specific language governing permissions and
9.\" limitations under the License. When distributing Covered Code, include this
10.\" CDDL HEADER in each file and include the License file at
11.\" usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this
12.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
13.\" own identifying information:
14.\" Portions Copyright [yyyy] [name of copyright owner]
15.TH ZFS-MODULE-PARAMETERS 5 "Nov 16, 2013"
16.SH NAME
17zfs\-module\-parameters \- ZFS module parameters
18.SH DESCRIPTION
19.sp
20.LP
21Description of the different parameters to the ZFS module.
22
23.SS "Module parameters"
24.sp
25.LP
26
27.sp
28.ne 2
29.na
30\fBl2arc_feed_again\fR (int)
31.ad
32.RS 12n
33Turbo L2ARC warmup
34.sp
35Use \fB1\fR for yes (default) and \fB0\fR to disable.
36.RE
37
38.sp
39.ne 2
40.na
41\fBl2arc_feed_min_ms\fR (ulong)
42.ad
43.RS 12n
44Min feed interval in milliseconds
45.sp
46Default value: \fB200\fR.
47.RE
48
49.sp
50.ne 2
51.na
52\fBl2arc_feed_secs\fR (ulong)
53.ad
54.RS 12n
55Seconds between L2ARC writing
56.sp
57Default value: \fB1\fR.
58.RE
59
60.sp
61.ne 2
62.na
63\fBl2arc_headroom\fR (ulong)
64.ad
65.RS 12n
66Number of max device writes to precache
67.sp
68Default value: \fB2\fR.
69.RE
70
71.sp
72.ne 2
73.na
74\fBl2arc_headroom_boost\fR (ulong)
75.ad
76.RS 12n
77Compressed l2arc_headroom multiplier
78.sp
79Default value: \fB200\fR.
80.RE
81
82.sp
83.ne 2
84.na
85\fBl2arc_nocompress\fR (int)
86.ad
87.RS 12n
88Skip compressing L2ARC buffers
89.sp
90Use \fB1\fR for yes and \fB0\fR for no (default).
91.RE
92
93.sp
94.ne 2
95.na
96\fBl2arc_noprefetch\fR (int)
97.ad
98.RS 12n
99Skip caching prefetched buffers
100.sp
101Use \fB1\fR for yes (default) and \fB0\fR to disable.
102.RE
103
104.sp
105.ne 2
106.na
107\fBl2arc_norw\fR (int)
108.ad
109.RS 12n
110No reads during writes
111.sp
112Use \fB1\fR for yes and \fB0\fR for no (default).
113.RE
114
115.sp
116.ne 2
117.na
118\fBl2arc_write_boost\fR (ulong)
119.ad
120.RS 12n
121Extra write bytes during device warmup
122.sp
123Default value: \fB8,388,608\fR.
124.RE
125
126.sp
127.ne 2
128.na
129\fBl2arc_write_max\fR (ulong)
130.ad
131.RS 12n
132Max write bytes per interval
133.sp
134Default value: \fB8,388,608\fR.
135.RE
136
99b14de4
ED
137.sp
138.ne 2
139.na
140\fBmetaslab_aliquot\fR (ulong)
141.ad
142.RS 12n
143Metaslab granularity, in bytes. This is roughly similar to what would be
144referred to as the "stripe size" in traditional RAID arrays. In normal
145operation, ZFS will try to write this amount of data to a top-level vdev
146before moving on to the next one.
147.sp
148Default value: \fB524,288\fR.
149.RE
150
f3a7f661
GW
151.sp
152.ne 2
153.na
154\fBmetaslab_bias_enabled\fR (int)
155.ad
156.RS 12n
157Enable metaslab group biasing based on its vdev's over- or under-utilization
158relative to the pool.
159.sp
160Use \fB1\fR for yes (default) and \fB0\fR for no.
161.RE
162
29714574
TF
163.sp
164.ne 2
165.na
aa7d06a9 166\fBmetaslab_debug_load\fR (int)
29714574
TF
167.ad
168.RS 12n
aa7d06a9
GW
169Load all metaslabs during pool import.
170.sp
171Use \fB1\fR for yes and \fB0\fR for no (default).
172.RE
173
174.sp
175.ne 2
176.na
177\fBmetaslab_debug_unload\fR (int)
178.ad
179.RS 12n
180Prevent metaslabs from being unloaded.
29714574
TF
181.sp
182Use \fB1\fR for yes and \fB0\fR for no (default).
183.RE
184
f3a7f661
GW
185.sp
186.ne 2
187.na
188\fBmetaslab_fragmentation_factor_enabled\fR (int)
189.ad
190.RS 12n
191Enable use of the fragmentation metric in computing metaslab weights.
192.sp
193Use \fB1\fR for yes (default) and \fB0\fR for no.
194.RE
195
b8bcca18
MA
196.sp
197.ne 2
198.na
199\fBmetaslabs_per_vdev\fR (int)
200.ad
201.RS 12n
202When a vdev is added, it will be divided into approximately (but no more than) this number of metaslabs.
203.sp
204Default value: \fB200\fR.
205.RE
206
f3a7f661
GW
207.sp
208.ne 2
209.na
210\fBmetaslab_preload_enabled\fR (int)
211.ad
212.RS 12n
213Enable metaslab group preloading.
214.sp
215Use \fB1\fR for yes (default) and \fB0\fR for no.
216.RE
217
218.sp
219.ne 2
220.na
221\fBmetaslab_lba_weighting_enabled\fR (int)
222.ad
223.RS 12n
224Give more weight to metaslabs with lower LBAs, assuming they have
225greater bandwidth as is typically the case on a modern constant
226angular velocity disk drive.
227.sp
228Use \fB1\fR for yes (default) and \fB0\fR for no.
229.RE
230
29714574
TF
231.sp
232.ne 2
233.na
234\fBspa_config_path\fR (charp)
235.ad
236.RS 12n
237SPA config file
238.sp
239Default value: \fB/etc/zfs/zpool.cache\fR.
240.RE
241
e8b96c60
MA
242.sp
243.ne 2
244.na
245\fBspa_asize_inflation\fR (int)
246.ad
247.RS 12n
248Multiplication factor used to estimate actual disk consumption from the
249size of data being written. The default value is a worst case estimate,
250but lower values may be valid for a given pool depending on its
251configuration. Pool administrators who understand the factors involved
252may wish to specify a more realistic inflation factor, particularly if
253they operate close to quota or capacity limits.
254.sp
255Default value: 24
256.RE
257
dea377c0
MA
258.sp
259.ne 2
260.na
261\fBspa_load_verify_data\fR (int)
262.ad
263.RS 12n
264Whether to traverse data blocks during an "extreme rewind" (\fB-X\fR)
265import. Use 0 to disable and 1 to enable.
266
267An extreme rewind import normally performs a full traversal of all
268blocks in the pool for verification. If this parameter is set to 0,
269the traversal skips non-metadata blocks. It can be toggled once the
270import has started to stop or start the traversal of non-metadata blocks.
271.sp
272Default value: 1
273.RE
274
275.sp
276.ne 2
277.na
278\fBspa_load_verify_metadata\fR (int)
279.ad
280.RS 12n
281Whether to traverse blocks during an "extreme rewind" (\fB-X\fR)
282pool import. Use 0 to disable and 1 to enable.
283
284An extreme rewind import normally performs a full traversal of all
285blocks in the pool for verification. If this parameter is set to 1,
286the traversal is not performed. It can be toggled once the import has
287started to stop or start the traversal.
288.sp
289Default value: 1
290.RE
291
292.sp
293.ne 2
294.na
295\fBspa_load_verify_maxinflight\fR (int)
296.ad
297.RS 12n
298Maximum concurrent I/Os during the traversal performed during an "extreme
299rewind" (\fB-X\fR) pool import.
300.sp
301Default value: 10000
302.RE
303
6cde6435
BB
304.sp
305.ne 2
306.na
307\fBspa_slop_shift\fR (int)
308.ad
309.RS 12n
310Normally, we don't allow the last 3.2% (1/(2^spa_slop_shift)) of space
311in the pool to be consumed. This ensures that we don't run the pool
312completely out of space, due to unaccounted changes (e.g. to the MOS).
313It also limits the worst-case time to allocate space. If we have
314less than this amount of free space, most ZPL operations (e.g. write,
315create) will return ENOSPC.
316.sp
317Default value: 5
318.RE
319
29714574
TF
320.sp
321.ne 2
322.na
323\fBzfetch_array_rd_sz\fR (ulong)
324.ad
325.RS 12n
27b293be 326If prefetching is enabled, disable prefetching for reads larger than this size.
29714574
TF
327.sp
328Default value: \fB1,048,576\fR.
329.RE
330
331.sp
332.ne 2
333.na
334\fBzfetch_block_cap\fR (uint)
335.ad
336.RS 12n
27b293be 337Max number of blocks to prefetch at a time
29714574
TF
338.sp
339Default value: \fB256\fR.
340.RE
341
342.sp
343.ne 2
344.na
345\fBzfetch_max_streams\fR (uint)
346.ad
347.RS 12n
27b293be 348Max number of streams per zfetch (prefetch streams per file).
29714574
TF
349.sp
350Default value: \fB8\fR.
351.RE
352
353.sp
354.ne 2
355.na
356\fBzfetch_min_sec_reap\fR (uint)
357.ad
358.RS 12n
27b293be 359Min time before an active prefetch stream can be reclaimed
29714574
TF
360.sp
361Default value: \fB2\fR.
362.RE
363
49ddb315
MA
364.sp
365.ne 2
366.na
367\fBzfs_arc_average_blocksize\fR (int)
368.ad
369.RS 12n
370The ARC's buffer hash table is sized based on the assumption of an average
371block size of \fBzfs_arc_average_blocksize\fR (default 8K). This works out
372to roughly 1MB of hash table per 1GB of physical memory with 8-byte pointers.
373For configurations with a known larger average block size this value can be
374increased to reduce the memory footprint.
375
376.sp
377Default value: \fB8192\fR.
378.RE
379
ca0bf58d
PS
380.sp
381.ne 2
382.na
383\fBzfs_arc_evict_batch_limit\fR (int)
384.ad
385.RS 12n
8f343973 386Number ARC headers to evict per sub-list before proceeding to another sub-list.
ca0bf58d
PS
387This batch-style operation prevents entire sub-lists from being evicted at once
388but comes at a cost of additional unlocking and locking.
389.sp
390Default value: \fB10\fR.
391.RE
392
29714574
TF
393.sp
394.ne 2
395.na
396\fBzfs_arc_grow_retry\fR (int)
397.ad
398.RS 12n
399Seconds before growing arc size
400.sp
401Default value: \fB5\fR.
402.RE
403
404.sp
405.ne 2
406.na
7e8bddd0 407\fBzfs_arc_lotsfree_percent\fR (int)
29714574
TF
408.ad
409.RS 12n
7e8bddd0
BB
410Throttle I/O when free system memory drops below this percentage of total
411system memory. Setting this value to 0 will disable the throttle.
29714574 412.sp
7e8bddd0 413Default value: \fB10\fR.
29714574
TF
414.RE
415
416.sp
417.ne 2
418.na
7e8bddd0 419\fBzfs_arc_max\fR (ulong)
29714574
TF
420.ad
421.RS 12n
7e8bddd0 422Max arc size
29714574 423.sp
7e8bddd0 424Default value: \fB0\fR.
29714574
TF
425.RE
426
427.sp
428.ne 2
429.na
430\fBzfs_arc_meta_limit\fR (ulong)
431.ad
432.RS 12n
2cbb06b5
BB
433The maximum allowed size in bytes that meta data buffers are allowed to
434consume in the ARC. When this limit is reached meta data buffers will
435be reclaimed even if the overall arc_c_max has not been reached. This
436value defaults to 0 which indicates that 3/4 of the ARC may be used
437for meta data.
29714574
TF
438.sp
439Default value: \fB0\fR.
440.RE
441
ca0bf58d
PS
442.sp
443.ne 2
444.na
445\fBzfs_arc_meta_min\fR (ulong)
446.ad
447.RS 12n
448The minimum allowed size in bytes that meta data buffers may consume in
449the ARC. This value defaults to 0 which disables a floor on the amount
450of the ARC devoted meta data.
451.sp
452Default value: \fB0\fR.
453.RE
454
29714574
TF
455.sp
456.ne 2
457.na
458\fBzfs_arc_meta_prune\fR (int)
459.ad
460.RS 12n
2cbb06b5
BB
461The number of dentries and inodes to be scanned looking for entries
462which can be dropped. This may be required when the ARC reaches the
463\fBzfs_arc_meta_limit\fR because dentries and inodes can pin buffers
464in the ARC. Increasing this value will cause to dentry and inode caches
465to be pruned more aggressively. Setting this value to 0 will disable
466pruning the inode and dentry caches.
29714574 467.sp
2cbb06b5 468Default value: \fB10,000\fR.
29714574
TF
469.RE
470
bc888666
BB
471.sp
472.ne 2
473.na
474\fBzfs_arc_meta_adjust_restarts\fR (ulong)
475.ad
476.RS 12n
477The number of restart passes to make while scanning the ARC attempting
478the free buffers in order to stay below the \fBzfs_arc_meta_limit\fR.
479This value should not need to be tuned but is available to facilitate
480performance analysis.
481.sp
482Default value: \fB4096\fR.
483.RE
484
29714574
TF
485.sp
486.ne 2
487.na
488\fBzfs_arc_min\fR (ulong)
489.ad
490.RS 12n
491Min arc size
492.sp
493Default value: \fB100\fR.
494.RE
495
496.sp
497.ne 2
498.na
499\fBzfs_arc_min_prefetch_lifespan\fR (int)
500.ad
501.RS 12n
502Min life of prefetch block
503.sp
504Default value: \fB100\fR.
505.RE
506
ca0bf58d
PS
507.sp
508.ne 2
509.na
510\fBzfs_arc_num_sublists_per_state\fR (int)
511.ad
512.RS 12n
513To allow more fine-grained locking, each ARC state contains a series
514of lists for both data and meta data objects. Locking is performed at
515the level of these "sub-lists". This parameters controls the number of
516sub-lists per ARC state.
517.sp
518Default value: 1 or the number of on-online CPUs, whichever is greater
519.RE
520
521.sp
522.ne 2
523.na
524\fBzfs_arc_overflow_shift\fR (int)
525.ad
526.RS 12n
527The ARC size is considered to be overflowing if it exceeds the current
528ARC target size (arc_c) by a threshold determined by this parameter.
529The threshold is calculated as a fraction of arc_c using the formula
530"arc_c >> \fBzfs_arc_overflow_shift\fR".
531
532The default value of 8 causes the ARC to be considered to be overflowing
533if it exceeds the target size by 1/256th (0.3%) of the target size.
534
535When the ARC is overflowing, new buffer allocations are stalled until
536the reclaim thread catches up and the overflow condition no longer exists.
537.sp
538Default value: \fB8\fR.
539.RE
540
728d6ae9
BB
541.sp
542.ne 2
543.na
544
545\fBzfs_arc_p_min_shift\fR (int)
546.ad
547.RS 12n
548arc_c shift to calc min/max arc_p
549.sp
550Default value: \fB4\fR.
551.RE
552
89c8cac4
PS
553.sp
554.ne 2
555.na
556\fBzfs_arc_p_aggressive_disable\fR (int)
557.ad
558.RS 12n
559Disable aggressive arc_p growth
560.sp
561Use \fB1\fR for yes (default) and \fB0\fR to disable.
562.RE
563
62422785
PS
564.sp
565.ne 2
566.na
567\fBzfs_arc_p_dampener_disable\fR (int)
568.ad
569.RS 12n
570Disable arc_p adapt dampener
571.sp
572Use \fB1\fR for yes (default) and \fB0\fR to disable.
573.RE
574
29714574
TF
575.sp
576.ne 2
577.na
578\fBzfs_arc_shrink_shift\fR (int)
579.ad
580.RS 12n
581log2(fraction of arc to reclaim)
582.sp
583Default value: \fB5\fR.
584.RE
585
11f552fa
BB
586.sp
587.ne 2
588.na
589\fBzfs_arc_sys_free\fR (ulong)
590.ad
591.RS 12n
592The target number of bytes the ARC should leave as free memory on the system.
593Defaults to the larger of 1/64 of physical memory or 512K. Setting this
594option to a non-zero value will override the default.
595.sp
596Default value: \fB0\fR.
597.RE
598
29714574
TF
599.sp
600.ne 2
601.na
602\fBzfs_autoimport_disable\fR (int)
603.ad
604.RS 12n
27b293be 605Disable pool import at module load by ignoring the cache file (typically \fB/etc/zfs/zpool.cache\fR).
29714574 606.sp
70081096 607Use \fB1\fR for yes (default) and \fB0\fR for no.
29714574
TF
608.RE
609
610.sp
611.ne 2
612.na
613\fBzfs_dbuf_state_index\fR (int)
614.ad
615.RS 12n
616Calculate arc header index
617.sp
618Default value: \fB0\fR.
619.RE
620
621.sp
622.ne 2
623.na
624\fBzfs_deadman_enabled\fR (int)
625.ad
626.RS 12n
627Enable deadman timer
628.sp
629Use \fB1\fR for yes (default) and \fB0\fR to disable.
630.RE
631
632.sp
633.ne 2
634.na
e8b96c60 635\fBzfs_deadman_synctime_ms\fR (ulong)
29714574
TF
636.ad
637.RS 12n
e8b96c60
MA
638Expiration time in milliseconds. This value has two meanings. First it is
639used to determine when the spa_deadman() logic should fire. By default the
640spa_deadman() will fire if spa_sync() has not completed in 1000 seconds.
641Secondly, the value determines if an I/O is considered "hung". Any I/O that
642has not completed in zfs_deadman_synctime_ms is considered "hung" resulting
643in a zevent being logged.
29714574 644.sp
e8b96c60 645Default value: \fB1,000,000\fR.
29714574
TF
646.RE
647
648.sp
649.ne 2
650.na
651\fBzfs_dedup_prefetch\fR (int)
652.ad
653.RS 12n
654Enable prefetching dedup-ed blks
655.sp
0dfc7324 656Use \fB1\fR for yes and \fB0\fR to disable (default).
29714574
TF
657.RE
658
e8b96c60
MA
659.sp
660.ne 2
661.na
662\fBzfs_delay_min_dirty_percent\fR (int)
663.ad
664.RS 12n
665Start to delay each transaction once there is this amount of dirty data,
666expressed as a percentage of \fBzfs_dirty_data_max\fR.
667This value should be >= zfs_vdev_async_write_active_max_dirty_percent.
668See the section "ZFS TRANSACTION DELAY".
669.sp
670Default value: \fB60\fR.
671.RE
672
673.sp
674.ne 2
675.na
676\fBzfs_delay_scale\fR (int)
677.ad
678.RS 12n
679This controls how quickly the transaction delay approaches infinity.
680Larger values cause longer delays for a given amount of dirty data.
681.sp
682For the smoothest delay, this value should be about 1 billion divided
683by the maximum number of operations per second. This will smoothly
684handle between 10x and 1/10th this number.
685.sp
686See the section "ZFS TRANSACTION DELAY".
687.sp
688Note: \fBzfs_delay_scale\fR * \fBzfs_dirty_data_max\fR must be < 2^64.
689.sp
690Default value: \fB500,000\fR.
691.RE
692
693.sp
694.ne 2
695.na
696\fBzfs_dirty_data_max\fR (int)
697.ad
698.RS 12n
699Determines the dirty space limit in bytes. Once this limit is exceeded, new
700writes are halted until space frees up. This parameter takes precedence
701over \fBzfs_dirty_data_max_percent\fR.
702See the section "ZFS TRANSACTION DELAY".
703.sp
704Default value: 10 percent of all memory, capped at \fBzfs_dirty_data_max_max\fR.
705.RE
706
707.sp
708.ne 2
709.na
710\fBzfs_dirty_data_max_max\fR (int)
711.ad
712.RS 12n
713Maximum allowable value of \fBzfs_dirty_data_max\fR, expressed in bytes.
714This limit is only enforced at module load time, and will be ignored if
715\fBzfs_dirty_data_max\fR is later changed. This parameter takes
716precedence over \fBzfs_dirty_data_max_max_percent\fR. See the section
717"ZFS TRANSACTION DELAY".
718.sp
719Default value: 25% of physical RAM.
720.RE
721
722.sp
723.ne 2
724.na
725\fBzfs_dirty_data_max_max_percent\fR (int)
726.ad
727.RS 12n
728Maximum allowable value of \fBzfs_dirty_data_max\fR, expressed as a
729percentage of physical RAM. This limit is only enforced at module load
730time, and will be ignored if \fBzfs_dirty_data_max\fR is later changed.
731The parameter \fBzfs_dirty_data_max_max\fR takes precedence over this
732one. See the section "ZFS TRANSACTION DELAY".
733.sp
734Default value: 25
735.RE
736
737.sp
738.ne 2
739.na
740\fBzfs_dirty_data_max_percent\fR (int)
741.ad
742.RS 12n
743Determines the dirty space limit, expressed as a percentage of all
744memory. Once this limit is exceeded, new writes are halted until space frees
745up. The parameter \fBzfs_dirty_data_max\fR takes precedence over this
746one. See the section "ZFS TRANSACTION DELAY".
747.sp
748Default value: 10%, subject to \fBzfs_dirty_data_max_max\fR.
749.RE
750
751.sp
752.ne 2
753.na
754\fBzfs_dirty_data_sync\fR (int)
755.ad
756.RS 12n
757Start syncing out a transaction group if there is at least this much dirty data.
758.sp
759Default value: \fB67,108,864\fR.
760.RE
761
36283ca2
MG
762.sp
763.ne 2
764.na
765\fBzfs_free_max_blocks\fR (ulong)
766.ad
767.RS 12n
768Maximum number of blocks freed in a single txg.
769.sp
770Default value: \fB100,000\fR.
771.RE
772
e8b96c60
MA
773.sp
774.ne 2
775.na
776\fBzfs_vdev_async_read_max_active\fR (int)
777.ad
778.RS 12n
779Maxium asynchronous read I/Os active to each device.
780See the section "ZFS I/O SCHEDULER".
781.sp
782Default value: \fB3\fR.
783.RE
784
785.sp
786.ne 2
787.na
788\fBzfs_vdev_async_read_min_active\fR (int)
789.ad
790.RS 12n
791Minimum asynchronous read I/Os active to each device.
792See the section "ZFS I/O SCHEDULER".
793.sp
794Default value: \fB1\fR.
795.RE
796
797.sp
798.ne 2
799.na
800\fBzfs_vdev_async_write_active_max_dirty_percent\fR (int)
801.ad
802.RS 12n
803When the pool has more than
804\fBzfs_vdev_async_write_active_max_dirty_percent\fR dirty data, use
805\fBzfs_vdev_async_write_max_active\fR to limit active async writes. If
806the dirty data is between min and max, the active I/O limit is linearly
807interpolated. See the section "ZFS I/O SCHEDULER".
808.sp
809Default value: \fB60\fR.
810.RE
811
812.sp
813.ne 2
814.na
815\fBzfs_vdev_async_write_active_min_dirty_percent\fR (int)
816.ad
817.RS 12n
818When the pool has less than
819\fBzfs_vdev_async_write_active_min_dirty_percent\fR dirty data, use
820\fBzfs_vdev_async_write_min_active\fR to limit active async writes. If
821the dirty data is between min and max, the active I/O limit is linearly
822interpolated. See the section "ZFS I/O SCHEDULER".
823.sp
824Default value: \fB30\fR.
825.RE
826
827.sp
828.ne 2
829.na
830\fBzfs_vdev_async_write_max_active\fR (int)
831.ad
832.RS 12n
833Maxium asynchronous write I/Os active to each device.
834See the section "ZFS I/O SCHEDULER".
835.sp
836Default value: \fB10\fR.
837.RE
838
839.sp
840.ne 2
841.na
842\fBzfs_vdev_async_write_min_active\fR (int)
843.ad
844.RS 12n
845Minimum asynchronous write I/Os active to each device.
846See the section "ZFS I/O SCHEDULER".
847.sp
848Default value: \fB1\fR.
849.RE
850
851.sp
852.ne 2
853.na
854\fBzfs_vdev_max_active\fR (int)
855.ad
856.RS 12n
857The maximum number of I/Os active to each device. Ideally, this will be >=
858the sum of each queue's max_active. It must be at least the sum of each
859queue's min_active. See the section "ZFS I/O SCHEDULER".
860.sp
861Default value: \fB1,000\fR.
862.RE
863
864.sp
865.ne 2
866.na
867\fBzfs_vdev_scrub_max_active\fR (int)
868.ad
869.RS 12n
870Maxium scrub I/Os active to each device.
871See the section "ZFS I/O SCHEDULER".
872.sp
873Default value: \fB2\fR.
874.RE
875
876.sp
877.ne 2
878.na
879\fBzfs_vdev_scrub_min_active\fR (int)
880.ad
881.RS 12n
882Minimum scrub I/Os active to each device.
883See the section "ZFS I/O SCHEDULER".
884.sp
885Default value: \fB1\fR.
886.RE
887
888.sp
889.ne 2
890.na
891\fBzfs_vdev_sync_read_max_active\fR (int)
892.ad
893.RS 12n
894Maxium synchronous read I/Os active to each device.
895See the section "ZFS I/O SCHEDULER".
896.sp
897Default value: \fB10\fR.
898.RE
899
900.sp
901.ne 2
902.na
903\fBzfs_vdev_sync_read_min_active\fR (int)
904.ad
905.RS 12n
906Minimum synchronous read I/Os active to each device.
907See the section "ZFS I/O SCHEDULER".
908.sp
909Default value: \fB10\fR.
910.RE
911
912.sp
913.ne 2
914.na
915\fBzfs_vdev_sync_write_max_active\fR (int)
916.ad
917.RS 12n
918Maxium synchronous write I/Os active to each device.
919See the section "ZFS I/O SCHEDULER".
920.sp
921Default value: \fB10\fR.
922.RE
923
924.sp
925.ne 2
926.na
927\fBzfs_vdev_sync_write_min_active\fR (int)
928.ad
929.RS 12n
930Minimum synchronous write I/Os active to each device.
931See the section "ZFS I/O SCHEDULER".
932.sp
933Default value: \fB10\fR.
934.RE
935
29714574
TF
936.sp
937.ne 2
938.na
939\fBzfs_disable_dup_eviction\fR (int)
940.ad
941.RS 12n
942Disable duplicate buffer eviction
943.sp
944Use \fB1\fR for yes and \fB0\fR for no (default).
945.RE
946
947.sp
948.ne 2
949.na
950\fBzfs_expire_snapshot\fR (int)
951.ad
952.RS 12n
953Seconds to expire .zfs/snapshot
954.sp
955Default value: \fB300\fR.
956.RE
957
0500e835
BB
958.sp
959.ne 2
960.na
961\fBzfs_admin_snapshot\fR (int)
962.ad
963.RS 12n
964Allow the creation, removal, or renaming of entries in the .zfs/snapshot
965directory to cause the creation, destruction, or renaming of snapshots.
966When enabled this functionality works both locally and over NFS exports
967which have the 'no_root_squash' option set. This functionality is disabled
968by default.
969.sp
970Use \fB1\fR for yes and \fB0\fR for no (default).
971.RE
972
29714574
TF
973.sp
974.ne 2
975.na
976\fBzfs_flags\fR (int)
977.ad
978.RS 12n
33b6dbbc
NB
979Set additional debugging flags. The following flags may be bitwise-or'd
980together.
981.sp
982.TS
983box;
984rB lB
985lB lB
986r l.
987Value Symbolic Name
988 Description
989_
9901 ZFS_DEBUG_DPRINTF
991 Enable dprintf entries in the debug log.
992_
9932 ZFS_DEBUG_DBUF_VERIFY *
994 Enable extra dbuf verifications.
995_
9964 ZFS_DEBUG_DNODE_VERIFY *
997 Enable extra dnode verifications.
998_
9998 ZFS_DEBUG_SNAPNAMES
1000 Enable snapshot name verification.
1001_
100216 ZFS_DEBUG_MODIFY
1003 Check for illegally modified ARC buffers.
1004_
100532 ZFS_DEBUG_SPA
1006 Enable spa_dbgmsg entries in the debug log.
1007_
100864 ZFS_DEBUG_ZIO_FREE
1009 Enable verification of block frees.
1010_
1011128 ZFS_DEBUG_HISTOGRAM_VERIFY
1012 Enable extra spacemap histogram verifications.
1013.TE
1014.sp
1015* Requires debug build.
29714574 1016.sp
33b6dbbc 1017Default value: \fB0\fR.
29714574
TF
1018.RE
1019
fbeddd60
MA
1020.sp
1021.ne 2
1022.na
1023\fBzfs_free_leak_on_eio\fR (int)
1024.ad
1025.RS 12n
1026If destroy encounters an EIO while reading metadata (e.g. indirect
1027blocks), space referenced by the missing metadata can not be freed.
1028Normally this causes the background destroy to become "stalled", as
1029it is unable to make forward progress. While in this stalled state,
1030all remaining space to free from the error-encountering filesystem is
1031"temporarily leaked". Set this flag to cause it to ignore the EIO,
1032permanently leak the space from indirect blocks that can not be read,
1033and continue to free everything else that it can.
1034
1035The default, "stalling" behavior is useful if the storage partially
1036fails (i.e. some but not all i/os fail), and then later recovers. In
1037this case, we will be able to continue pool operations while it is
1038partially failed, and when it recovers, we can continue to free the
1039space, with no leaks. However, note that this case is actually
1040fairly rare.
1041
1042Typically pools either (a) fail completely (but perhaps temporarily,
1043e.g. a top-level vdev going offline), or (b) have localized,
1044permanent errors (e.g. disk returns the wrong data due to bit flip or
1045firmware bug). In case (a), this setting does not matter because the
1046pool will be suspended and the sync thread will not be able to make
1047forward progress regardless. In case (b), because the error is
1048permanent, the best we can do is leak the minimum amount of space,
1049which is what setting this flag will do. Therefore, it is reasonable
1050for this flag to normally be set, but we chose the more conservative
1051approach of not setting it, so that there is no possibility of
1052leaking space in the "partial temporary" failure case.
1053.sp
1054Default value: \fB0\fR.
1055.RE
1056
29714574
TF
1057.sp
1058.ne 2
1059.na
1060\fBzfs_free_min_time_ms\fR (int)
1061.ad
1062.RS 12n
1063Min millisecs to free per txg
1064.sp
1065Default value: \fB1,000\fR.
1066.RE
1067
1068.sp
1069.ne 2
1070.na
1071\fBzfs_immediate_write_sz\fR (long)
1072.ad
1073.RS 12n
1074Largest data block to write to zil
1075.sp
1076Default value: \fB32,768\fR.
1077.RE
1078
f1512ee6
MA
1079.sp
1080.ne 2
1081.na
1082\fBzfs_max_recordsize\fR (int)
1083.ad
1084.RS 12n
1085We currently support block sizes from 512 bytes to 16MB. The benefits of
1086larger blocks, and thus larger IO, need to be weighed against the cost of
1087COWing a giant block to modify one byte. Additionally, very large blocks
1088can have an impact on i/o latency, and also potentially on the memory
1089allocator. Therefore, we do not allow the recordsize to be set larger than
1090zfs_max_recordsize (default 1MB). Larger blocks can be created by changing
1091this tunable, and pools with larger blocks can always be imported and used,
1092regardless of this setting.
1093.sp
1094Default value: \fB1,048,576\fR.
1095.RE
1096
29714574
TF
1097.sp
1098.ne 2
1099.na
1100\fBzfs_mdcomp_disable\fR (int)
1101.ad
1102.RS 12n
1103Disable meta data compression
1104.sp
1105Use \fB1\fR for yes and \fB0\fR for no (default).
1106.RE
1107
f3a7f661
GW
1108.sp
1109.ne 2
1110.na
1111\fBzfs_metaslab_fragmentation_threshold\fR (int)
1112.ad
1113.RS 12n
1114Allow metaslabs to keep their active state as long as their fragmentation
1115percentage is less than or equal to this value. An active metaslab that
1116exceeds this threshold will no longer keep its active status allowing
1117better metaslabs to be selected.
1118.sp
1119Default value: \fB70\fR.
1120.RE
1121
1122.sp
1123.ne 2
1124.na
1125\fBzfs_mg_fragmentation_threshold\fR (int)
1126.ad
1127.RS 12n
1128Metaslab groups are considered eligible for allocations if their
1129fragmenation metric (measured as a percentage) is less than or equal to
1130this value. If a metaslab group exceeds this threshold then it will be
1131skipped unless all metaslab groups within the metaslab class have also
1132crossed this threshold.
1133.sp
1134Default value: \fB85\fR.
1135.RE
1136
f4a4046b
TC
1137.sp
1138.ne 2
1139.na
1140\fBzfs_mg_noalloc_threshold\fR (int)
1141.ad
1142.RS 12n
1143Defines a threshold at which metaslab groups should be eligible for
1144allocations. The value is expressed as a percentage of free space
1145beyond which a metaslab group is always eligible for allocations.
1146If a metaslab group's free space is less than or equal to the
1147the threshold, the allocator will avoid allocating to that group
1148unless all groups in the pool have reached the threshold. Once all
1149groups have reached the threshold, all groups are allowed to accept
1150allocations. The default value of 0 disables the feature and causes
1151all metaslab groups to be eligible for allocations.
1152
1153This parameter allows to deal with pools having heavily imbalanced
1154vdevs such as would be the case when a new vdev has been added.
1155Setting the threshold to a non-zero percentage will stop allocations
1156from being made to vdevs that aren't filled to the specified percentage
1157and allow lesser filled vdevs to acquire more allocations than they
1158otherwise would under the old \fBzfs_mg_alloc_failures\fR facility.
1159.sp
1160Default value: \fB0\fR.
1161.RE
1162
29714574
TF
1163.sp
1164.ne 2
1165.na
1166\fBzfs_no_scrub_io\fR (int)
1167.ad
1168.RS 12n
1169Set for no scrub I/O
1170.sp
1171Use \fB1\fR for yes and \fB0\fR for no (default).
1172.RE
1173
1174.sp
1175.ne 2
1176.na
1177\fBzfs_no_scrub_prefetch\fR (int)
1178.ad
1179.RS 12n
1180Set for no scrub prefetching
1181.sp
1182Use \fB1\fR for yes and \fB0\fR for no (default).
1183.RE
1184
29714574
TF
1185.sp
1186.ne 2
1187.na
1188\fBzfs_nocacheflush\fR (int)
1189.ad
1190.RS 12n
1191Disable cache flushes
1192.sp
1193Use \fB1\fR for yes and \fB0\fR for no (default).
1194.RE
1195
1196.sp
1197.ne 2
1198.na
1199\fBzfs_nopwrite_enabled\fR (int)
1200.ad
1201.RS 12n
1202Enable NOP writes
1203.sp
1204Use \fB1\fR for yes (default) and \fB0\fR to disable.
1205.RE
1206
1207.sp
1208.ne 2
1209.na
b738bc5a 1210\fBzfs_pd_bytes_max\fR (int)
29714574
TF
1211.ad
1212.RS 12n
b738bc5a 1213The number of bytes which should be prefetched.
29714574 1214.sp
74aa2ba2 1215Default value: \fB52,428,800\fR.
29714574
TF
1216.RE
1217
1218.sp
1219.ne 2
1220.na
1221\fBzfs_prefetch_disable\fR (int)
1222.ad
1223.RS 12n
1224Disable all ZFS prefetching
1225.sp
1226Use \fB1\fR for yes and \fB0\fR for no (default).
1227.RE
1228
1229.sp
1230.ne 2
1231.na
1232\fBzfs_read_chunk_size\fR (long)
1233.ad
1234.RS 12n
1235Bytes to read per chunk
1236.sp
1237Default value: \fB1,048,576\fR.
1238.RE
1239
1240.sp
1241.ne 2
1242.na
1243\fBzfs_read_history\fR (int)
1244.ad
1245.RS 12n
1246Historic statistics for the last N reads
1247.sp
1248Default value: \fB0\fR.
1249.RE
1250
1251.sp
1252.ne 2
1253.na
1254\fBzfs_read_history_hits\fR (int)
1255.ad
1256.RS 12n
1257Include cache hits in read history
1258.sp
1259Use \fB1\fR for yes and \fB0\fR for no (default).
1260.RE
1261
1262.sp
1263.ne 2
1264.na
1265\fBzfs_recover\fR (int)
1266.ad
1267.RS 12n
1268Set to attempt to recover from fatal errors. This should only be used as a
1269last resort, as it typically results in leaked space, or worse.
1270.sp
1271Use \fB1\fR for yes and \fB0\fR for no (default).
1272.RE
1273
1274.sp
1275.ne 2
1276.na
1277\fBzfs_resilver_delay\fR (int)
1278.ad
1279.RS 12n
27b293be
TC
1280Number of ticks to delay prior to issuing a resilver I/O operation when
1281a non-resilver or non-scrub I/O operation has occurred within the past
1282\fBzfs_scan_idle\fR ticks.
29714574
TF
1283.sp
1284Default value: \fB2\fR.
1285.RE
1286
1287.sp
1288.ne 2
1289.na
1290\fBzfs_resilver_min_time_ms\fR (int)
1291.ad
1292.RS 12n
1293Min millisecs to resilver per txg
1294.sp
1295Default value: \fB3,000\fR.
1296.RE
1297
1298.sp
1299.ne 2
1300.na
1301\fBzfs_scan_idle\fR (int)
1302.ad
1303.RS 12n
27b293be
TC
1304Idle window in clock ticks. During a scrub or a resilver, if
1305a non-scrub or non-resilver I/O operation has occurred during this
1306window, the next scrub or resilver operation is delayed by, respectively
1307\fBzfs_scrub_delay\fR or \fBzfs_resilver_delay\fR ticks.
29714574
TF
1308.sp
1309Default value: \fB50\fR.
1310.RE
1311
1312.sp
1313.ne 2
1314.na
1315\fBzfs_scan_min_time_ms\fR (int)
1316.ad
1317.RS 12n
1318Min millisecs to scrub per txg
1319.sp
1320Default value: \fB1,000\fR.
1321.RE
1322
1323.sp
1324.ne 2
1325.na
1326\fBzfs_scrub_delay\fR (int)
1327.ad
1328.RS 12n
27b293be
TC
1329Number of ticks to delay prior to issuing a scrub I/O operation when
1330a non-scrub or non-resilver I/O operation has occurred within the past
1331\fBzfs_scan_idle\fR ticks.
29714574
TF
1332.sp
1333Default value: \fB4\fR.
1334.RE
1335
fd8febbd
TF
1336.sp
1337.ne 2
1338.na
1339\fBzfs_send_corrupt_data\fR (int)
1340.ad
1341.RS 12n
1342Allow to send corrupt data (ignore read/checksum errors when sending data)
1343.sp
1344Use \fB1\fR for yes and \fB0\fR for no (default).
1345.RE
1346
29714574
TF
1347.sp
1348.ne 2
1349.na
1350\fBzfs_sync_pass_deferred_free\fR (int)
1351.ad
1352.RS 12n
1353Defer frees starting in this pass
1354.sp
1355Default value: \fB2\fR.
1356.RE
1357
1358.sp
1359.ne 2
1360.na
1361\fBzfs_sync_pass_dont_compress\fR (int)
1362.ad
1363.RS 12n
1364Don't compress starting in this pass
1365.sp
1366Default value: \fB5\fR.
1367.RE
1368
1369.sp
1370.ne 2
1371.na
1372\fBzfs_sync_pass_rewrite\fR (int)
1373.ad
1374.RS 12n
1375Rewrite new bps starting in this pass
1376.sp
1377Default value: \fB2\fR.
1378.RE
1379
1380.sp
1381.ne 2
1382.na
1383\fBzfs_top_maxinflight\fR (int)
1384.ad
1385.RS 12n
27b293be 1386Max I/Os per top-level vdev during scrub or resilver operations.
29714574
TF
1387.sp
1388Default value: \fB32\fR.
1389.RE
1390
1391.sp
1392.ne 2
1393.na
1394\fBzfs_txg_history\fR (int)
1395.ad
1396.RS 12n
1397Historic statistics for the last N txgs
1398.sp
1399Default value: \fB0\fR.
1400.RE
1401
29714574
TF
1402.sp
1403.ne 2
1404.na
1405\fBzfs_txg_timeout\fR (int)
1406.ad
1407.RS 12n
1408Max seconds worth of delta per txg
1409.sp
1410Default value: \fB5\fR.
1411.RE
1412
1413.sp
1414.ne 2
1415.na
1416\fBzfs_vdev_aggregation_limit\fR (int)
1417.ad
1418.RS 12n
1419Max vdev I/O aggregation size
1420.sp
1421Default value: \fB131,072\fR.
1422.RE
1423
1424.sp
1425.ne 2
1426.na
1427\fBzfs_vdev_cache_bshift\fR (int)
1428.ad
1429.RS 12n
1430Shift size to inflate reads too
1431.sp
1432Default value: \fB16\fR.
1433.RE
1434
1435.sp
1436.ne 2
1437.na
1438\fBzfs_vdev_cache_max\fR (int)
1439.ad
1440.RS 12n
1441Inflate reads small than max
1442.RE
1443
1444.sp
1445.ne 2
1446.na
1447\fBzfs_vdev_cache_size\fR (int)
1448.ad
1449.RS 12n
1450Total size of the per-disk cache
1451.sp
1452Default value: \fB0\fR.
1453.RE
1454
29714574
TF
1455.sp
1456.ne 2
1457.na
1458\fBzfs_vdev_mirror_switch_us\fR (int)
1459.ad
1460.RS 12n
1461Switch mirrors every N usecs
1462.sp
1463Default value: \fB10,000\fR.
1464.RE
1465
29714574
TF
1466.sp
1467.ne 2
1468.na
1469\fBzfs_vdev_read_gap_limit\fR (int)
1470.ad
1471.RS 12n
1472Aggregate read I/O over gap
1473.sp
1474Default value: \fB32,768\fR.
1475.RE
1476
1477.sp
1478.ne 2
1479.na
1480\fBzfs_vdev_scheduler\fR (charp)
1481.ad
1482.RS 12n
1483I/O scheduler
1484.sp
1485Default value: \fBnoop\fR.
1486.RE
1487
29714574
TF
1488.sp
1489.ne 2
1490.na
1491\fBzfs_vdev_write_gap_limit\fR (int)
1492.ad
1493.RS 12n
1494Aggregate write I/O over gap
1495.sp
1496Default value: \fB4,096\fR.
1497.RE
1498
29714574
TF
1499.sp
1500.ne 2
1501.na
1502\fBzfs_zevent_cols\fR (int)
1503.ad
1504.RS 12n
1505Max event column width
1506.sp
1507Default value: \fB80\fR.
1508.RE
1509
1510.sp
1511.ne 2
1512.na
1513\fBzfs_zevent_console\fR (int)
1514.ad
1515.RS 12n
1516Log events to the console
1517.sp
1518Use \fB1\fR for yes and \fB0\fR for no (default).
1519.RE
1520
1521.sp
1522.ne 2
1523.na
1524\fBzfs_zevent_len_max\fR (int)
1525.ad
1526.RS 12n
1527Max event queue length
1528.sp
1529Default value: \fB0\fR.
1530.RE
1531
1532.sp
1533.ne 2
1534.na
1535\fBzil_replay_disable\fR (int)
1536.ad
1537.RS 12n
1538Disable intent logging replay
1539.sp
1540Use \fB1\fR for yes and \fB0\fR for no (default).
1541.RE
1542
1543.sp
1544.ne 2
1545.na
1546\fBzil_slog_limit\fR (ulong)
1547.ad
1548.RS 12n
1549Max commit bytes to separate log device
1550.sp
1551Default value: \fB1,048,576\fR.
1552.RE
1553
29714574
TF
1554.sp
1555.ne 2
1556.na
1557\fBzio_delay_max\fR (int)
1558.ad
1559.RS 12n
1560Max zio millisec delay before posting event
1561.sp
1562Default value: \fB30,000\fR.
1563.RE
1564
29714574
TF
1565.sp
1566.ne 2
1567.na
1568\fBzio_requeue_io_start_cut_in_line\fR (int)
1569.ad
1570.RS 12n
1571Prioritize requeued I/O
1572.sp
1573Default value: \fB0\fR.
1574.RE
1575
1576.sp
1577.ne 2
1578.na
1579\fBzvol_inhibit_dev\fR (uint)
1580.ad
1581.RS 12n
1582Do not create zvol device nodes
1583.sp
1584Use \fB1\fR for yes and \fB0\fR for no (default).
1585.RE
1586
1587.sp
1588.ne 2
1589.na
1590\fBzvol_major\fR (uint)
1591.ad
1592.RS 12n
1593Major number for zvol device
1594.sp
1595Default value: \fB230\fR.
1596.RE
1597
1598.sp
1599.ne 2
1600.na
1601\fBzvol_max_discard_blocks\fR (ulong)
1602.ad
1603.RS 12n
1604Max number of blocks to discard at once
1605.sp
1606Default value: \fB16,384\fR.
1607.RE
1608
e8b96c60
MA
1609.SH ZFS I/O SCHEDULER
1610ZFS issues I/O operations to leaf vdevs to satisfy and complete I/Os.
1611The I/O scheduler determines when and in what order those operations are
1612issued. The I/O scheduler divides operations into five I/O classes
1613prioritized in the following order: sync read, sync write, async read,
1614async write, and scrub/resilver. Each queue defines the minimum and
1615maximum number of concurrent operations that may be issued to the
1616device. In addition, the device has an aggregate maximum,
1617\fBzfs_vdev_max_active\fR. Note that the sum of the per-queue minimums
1618must not exceed the aggregate maximum. If the sum of the per-queue
1619maximums exceeds the aggregate maximum, then the number of active I/Os
1620may reach \fBzfs_vdev_max_active\fR, in which case no further I/Os will
1621be issued regardless of whether all per-queue minimums have been met.
1622.sp
1623For many physical devices, throughput increases with the number of
1624concurrent operations, but latency typically suffers. Further, physical
1625devices typically have a limit at which more concurrent operations have no
1626effect on throughput or can actually cause it to decrease.
1627.sp
1628The scheduler selects the next operation to issue by first looking for an
1629I/O class whose minimum has not been satisfied. Once all are satisfied and
1630the aggregate maximum has not been hit, the scheduler looks for classes
1631whose maximum has not been satisfied. Iteration through the I/O classes is
1632done in the order specified above. No further operations are issued if the
1633aggregate maximum number of concurrent operations has been hit or if there
1634are no operations queued for an I/O class that has not hit its maximum.
1635Every time an I/O is queued or an operation completes, the I/O scheduler
1636looks for new operations to issue.
1637.sp
1638In general, smaller max_active's will lead to lower latency of synchronous
1639operations. Larger max_active's may lead to higher overall throughput,
1640depending on underlying storage.
1641.sp
1642The ratio of the queues' max_actives determines the balance of performance
1643between reads, writes, and scrubs. E.g., increasing
1644\fBzfs_vdev_scrub_max_active\fR will cause the scrub or resilver to complete
1645more quickly, but reads and writes to have higher latency and lower throughput.
1646.sp
1647All I/O classes have a fixed maximum number of outstanding operations
1648except for the async write class. Asynchronous writes represent the data
1649that is committed to stable storage during the syncing stage for
1650transaction groups. Transaction groups enter the syncing state
1651periodically so the number of queued async writes will quickly burst up
1652and then bleed down to zero. Rather than servicing them as quickly as
1653possible, the I/O scheduler changes the maximum number of active async
1654write I/Os according to the amount of dirty data in the pool. Since
1655both throughput and latency typically increase with the number of
1656concurrent operations issued to physical devices, reducing the
1657burstiness in the number of concurrent operations also stabilizes the
1658response time of operations from other -- and in particular synchronous
1659-- queues. In broad strokes, the I/O scheduler will issue more
1660concurrent operations from the async write queue as there's more dirty
1661data in the pool.
1662.sp
1663Async Writes
1664.sp
1665The number of concurrent operations issued for the async write I/O class
1666follows a piece-wise linear function defined by a few adjustable points.
1667.nf
1668
1669 | o---------| <-- zfs_vdev_async_write_max_active
1670 ^ | /^ |
1671 | | / | |
1672active | / | |
1673 I/O | / | |
1674count | / | |
1675 | / | |
1676 |-------o | | <-- zfs_vdev_async_write_min_active
1677 0|_______^______|_________|
1678 0% | | 100% of zfs_dirty_data_max
1679 | |
1680 | `-- zfs_vdev_async_write_active_max_dirty_percent
1681 `--------- zfs_vdev_async_write_active_min_dirty_percent
1682
1683.fi
1684Until the amount of dirty data exceeds a minimum percentage of the dirty
1685data allowed in the pool, the I/O scheduler will limit the number of
1686concurrent operations to the minimum. As that threshold is crossed, the
1687number of concurrent operations issued increases linearly to the maximum at
1688the specified maximum percentage of the dirty data allowed in the pool.
1689.sp
1690Ideally, the amount of dirty data on a busy pool will stay in the sloped
1691part of the function between \fBzfs_vdev_async_write_active_min_dirty_percent\fR
1692and \fBzfs_vdev_async_write_active_max_dirty_percent\fR. If it exceeds the
1693maximum percentage, this indicates that the rate of incoming data is
1694greater than the rate that the backend storage can handle. In this case, we
1695must further throttle incoming writes, as described in the next section.
1696
1697.SH ZFS TRANSACTION DELAY
1698We delay transactions when we've determined that the backend storage
1699isn't able to accommodate the rate of incoming writes.
1700.sp
1701If there is already a transaction waiting, we delay relative to when
1702that transaction will finish waiting. This way the calculated delay time
1703is independent of the number of threads concurrently executing
1704transactions.
1705.sp
1706If we are the only waiter, wait relative to when the transaction
1707started, rather than the current time. This credits the transaction for
1708"time already served", e.g. reading indirect blocks.
1709.sp
1710The minimum time for a transaction to take is calculated as:
1711.nf
1712 min_time = zfs_delay_scale * (dirty - min) / (max - dirty)
1713 min_time is then capped at 100 milliseconds.
1714.fi
1715.sp
1716The delay has two degrees of freedom that can be adjusted via tunables. The
1717percentage of dirty data at which we start to delay is defined by
1718\fBzfs_delay_min_dirty_percent\fR. This should typically be at or above
1719\fBzfs_vdev_async_write_active_max_dirty_percent\fR so that we only start to
1720delay after writing at full speed has failed to keep up with the incoming write
1721rate. The scale of the curve is defined by \fBzfs_delay_scale\fR. Roughly speaking,
1722this variable determines the amount of delay at the midpoint of the curve.
1723.sp
1724.nf
1725delay
1726 10ms +-------------------------------------------------------------*+
1727 | *|
1728 9ms + *+
1729 | *|
1730 8ms + *+
1731 | * |
1732 7ms + * +
1733 | * |
1734 6ms + * +
1735 | * |
1736 5ms + * +
1737 | * |
1738 4ms + * +
1739 | * |
1740 3ms + * +
1741 | * |
1742 2ms + (midpoint) * +
1743 | | ** |
1744 1ms + v *** +
1745 | zfs_delay_scale ----------> ******** |
1746 0 +-------------------------------------*********----------------+
1747 0% <- zfs_dirty_data_max -> 100%
1748.fi
1749.sp
1750Note that since the delay is added to the outstanding time remaining on the
1751most recent transaction, the delay is effectively the inverse of IOPS.
1752Here the midpoint of 500us translates to 2000 IOPS. The shape of the curve
1753was chosen such that small changes in the amount of accumulated dirty data
1754in the first 3/4 of the curve yield relatively small differences in the
1755amount of delay.
1756.sp
1757The effects can be easier to understand when the amount of delay is
1758represented on a log scale:
1759.sp
1760.nf
1761delay
1762100ms +-------------------------------------------------------------++
1763 + +
1764 | |
1765 + *+
1766 10ms + *+
1767 + ** +
1768 | (midpoint) ** |
1769 + | ** +
1770 1ms + v **** +
1771 + zfs_delay_scale ----------> ***** +
1772 | **** |
1773 + **** +
1774100us + ** +
1775 + * +
1776 | * |
1777 + * +
1778 10us + * +
1779 + +
1780 | |
1781 + +
1782 +--------------------------------------------------------------+
1783 0% <- zfs_dirty_data_max -> 100%
1784.fi
1785.sp
1786Note here that only as the amount of dirty data approaches its limit does
1787the delay start to increase rapidly. The goal of a properly tuned system
1788should be to keep the amount of dirty data out of that range by first
1789ensuring that the appropriate limits are set for the I/O scheduler to reach
1790optimal throughput on the backend storage, and then by changing the value
1791of \fBzfs_delay_scale\fR to increase the steepness of the curve.