]> git.proxmox.com Git - mirror_zfs.git/blame - man/man5/zfs-module-parameters.5
Illumos 6251 - add tunable to disable free_bpobj processing
[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
7f60329a 334\fBzfetch_max_distance\fR (uint)
29714574
TF
335.ad
336.RS 12n
7f60329a 337Max bytes to prefetch per stream (default 8MB).
29714574 338.sp
7f60329a 339Default value: \fB8,388,608\fR.
29714574
TF
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
3b36f831
BB
610.sp
611.ne 2
612.na
613\fBzfs_dbgmsg_enable\fR (int)
614.ad
615.RS 12n
616Internally ZFS keeps a small log to facilitate debugging. By default the log
617is disabled, to enable it set this option to 1. The contents of the log can
618be accessed by reading the /proc/spl/kstat/zfs/dbgmsg file. Writing 0 to
619this proc file clears the log.
620.sp
621Default value: \fB0\fR.
622.RE
623
624.sp
625.ne 2
626.na
627\fBzfs_dbgmsg_maxsize\fR (int)
628.ad
629.RS 12n
630The maximum size in bytes of the internal ZFS debug log.
631.sp
632Default value: \fB4M\fR.
633.RE
634
29714574
TF
635.sp
636.ne 2
637.na
638\fBzfs_dbuf_state_index\fR (int)
639.ad
640.RS 12n
641Calculate arc header index
642.sp
643Default value: \fB0\fR.
644.RE
645
646.sp
647.ne 2
648.na
649\fBzfs_deadman_enabled\fR (int)
650.ad
651.RS 12n
652Enable deadman timer
653.sp
654Use \fB1\fR for yes (default) and \fB0\fR to disable.
655.RE
656
657.sp
658.ne 2
659.na
e8b96c60 660\fBzfs_deadman_synctime_ms\fR (ulong)
29714574
TF
661.ad
662.RS 12n
e8b96c60
MA
663Expiration time in milliseconds. This value has two meanings. First it is
664used to determine when the spa_deadman() logic should fire. By default the
665spa_deadman() will fire if spa_sync() has not completed in 1000 seconds.
666Secondly, the value determines if an I/O is considered "hung". Any I/O that
667has not completed in zfs_deadman_synctime_ms is considered "hung" resulting
668in a zevent being logged.
29714574 669.sp
e8b96c60 670Default value: \fB1,000,000\fR.
29714574
TF
671.RE
672
673.sp
674.ne 2
675.na
676\fBzfs_dedup_prefetch\fR (int)
677.ad
678.RS 12n
679Enable prefetching dedup-ed blks
680.sp
0dfc7324 681Use \fB1\fR for yes and \fB0\fR to disable (default).
29714574
TF
682.RE
683
e8b96c60
MA
684.sp
685.ne 2
686.na
687\fBzfs_delay_min_dirty_percent\fR (int)
688.ad
689.RS 12n
690Start to delay each transaction once there is this amount of dirty data,
691expressed as a percentage of \fBzfs_dirty_data_max\fR.
692This value should be >= zfs_vdev_async_write_active_max_dirty_percent.
693See the section "ZFS TRANSACTION DELAY".
694.sp
695Default value: \fB60\fR.
696.RE
697
698.sp
699.ne 2
700.na
701\fBzfs_delay_scale\fR (int)
702.ad
703.RS 12n
704This controls how quickly the transaction delay approaches infinity.
705Larger values cause longer delays for a given amount of dirty data.
706.sp
707For the smoothest delay, this value should be about 1 billion divided
708by the maximum number of operations per second. This will smoothly
709handle between 10x and 1/10th this number.
710.sp
711See the section "ZFS TRANSACTION DELAY".
712.sp
713Note: \fBzfs_delay_scale\fR * \fBzfs_dirty_data_max\fR must be < 2^64.
714.sp
715Default value: \fB500,000\fR.
716.RE
717
718.sp
719.ne 2
720.na
721\fBzfs_dirty_data_max\fR (int)
722.ad
723.RS 12n
724Determines the dirty space limit in bytes. Once this limit is exceeded, new
725writes are halted until space frees up. This parameter takes precedence
726over \fBzfs_dirty_data_max_percent\fR.
727See the section "ZFS TRANSACTION DELAY".
728.sp
729Default value: 10 percent of all memory, capped at \fBzfs_dirty_data_max_max\fR.
730.RE
731
732.sp
733.ne 2
734.na
735\fBzfs_dirty_data_max_max\fR (int)
736.ad
737.RS 12n
738Maximum allowable value of \fBzfs_dirty_data_max\fR, expressed in bytes.
739This limit is only enforced at module load time, and will be ignored if
740\fBzfs_dirty_data_max\fR is later changed. This parameter takes
741precedence over \fBzfs_dirty_data_max_max_percent\fR. See the section
742"ZFS TRANSACTION DELAY".
743.sp
744Default value: 25% of physical RAM.
745.RE
746
747.sp
748.ne 2
749.na
750\fBzfs_dirty_data_max_max_percent\fR (int)
751.ad
752.RS 12n
753Maximum allowable value of \fBzfs_dirty_data_max\fR, expressed as a
754percentage of physical RAM. This limit is only enforced at module load
755time, and will be ignored if \fBzfs_dirty_data_max\fR is later changed.
756The parameter \fBzfs_dirty_data_max_max\fR takes precedence over this
757one. See the section "ZFS TRANSACTION DELAY".
758.sp
759Default value: 25
760.RE
761
762.sp
763.ne 2
764.na
765\fBzfs_dirty_data_max_percent\fR (int)
766.ad
767.RS 12n
768Determines the dirty space limit, expressed as a percentage of all
769memory. Once this limit is exceeded, new writes are halted until space frees
770up. The parameter \fBzfs_dirty_data_max\fR takes precedence over this
771one. See the section "ZFS TRANSACTION DELAY".
772.sp
773Default value: 10%, subject to \fBzfs_dirty_data_max_max\fR.
774.RE
775
776.sp
777.ne 2
778.na
779\fBzfs_dirty_data_sync\fR (int)
780.ad
781.RS 12n
782Start syncing out a transaction group if there is at least this much dirty data.
783.sp
784Default value: \fB67,108,864\fR.
785.RE
786
ba5ad9a4
GW
787.sp
788.ne 2
789.na
790\fBzfs_free_bpobj_enabled\fR (int)
791.ad
792.RS 12n
793Enable/disable the processing of the free_bpobj object.
794.sp
795Default value: \fB1\fR.
796.RE
797
36283ca2
MG
798.sp
799.ne 2
800.na
801\fBzfs_free_max_blocks\fR (ulong)
802.ad
803.RS 12n
804Maximum number of blocks freed in a single txg.
805.sp
806Default value: \fB100,000\fR.
807.RE
808
e8b96c60
MA
809.sp
810.ne 2
811.na
812\fBzfs_vdev_async_read_max_active\fR (int)
813.ad
814.RS 12n
815Maxium asynchronous read I/Os active to each device.
816See the section "ZFS I/O SCHEDULER".
817.sp
818Default value: \fB3\fR.
819.RE
820
821.sp
822.ne 2
823.na
824\fBzfs_vdev_async_read_min_active\fR (int)
825.ad
826.RS 12n
827Minimum asynchronous read I/Os active to each device.
828See the section "ZFS I/O SCHEDULER".
829.sp
830Default value: \fB1\fR.
831.RE
832
833.sp
834.ne 2
835.na
836\fBzfs_vdev_async_write_active_max_dirty_percent\fR (int)
837.ad
838.RS 12n
839When the pool has more than
840\fBzfs_vdev_async_write_active_max_dirty_percent\fR dirty data, use
841\fBzfs_vdev_async_write_max_active\fR to limit active async writes. If
842the dirty data is between min and max, the active I/O limit is linearly
843interpolated. See the section "ZFS I/O SCHEDULER".
844.sp
845Default value: \fB60\fR.
846.RE
847
848.sp
849.ne 2
850.na
851\fBzfs_vdev_async_write_active_min_dirty_percent\fR (int)
852.ad
853.RS 12n
854When the pool has less than
855\fBzfs_vdev_async_write_active_min_dirty_percent\fR dirty data, use
856\fBzfs_vdev_async_write_min_active\fR to limit active async writes. If
857the dirty data is between min and max, the active I/O limit is linearly
858interpolated. See the section "ZFS I/O SCHEDULER".
859.sp
860Default value: \fB30\fR.
861.RE
862
863.sp
864.ne 2
865.na
866\fBzfs_vdev_async_write_max_active\fR (int)
867.ad
868.RS 12n
869Maxium asynchronous write I/Os active to each device.
870See the section "ZFS I/O SCHEDULER".
871.sp
872Default value: \fB10\fR.
873.RE
874
875.sp
876.ne 2
877.na
878\fBzfs_vdev_async_write_min_active\fR (int)
879.ad
880.RS 12n
881Minimum asynchronous write I/Os active to each device.
882See the section "ZFS I/O SCHEDULER".
883.sp
884Default value: \fB1\fR.
885.RE
886
887.sp
888.ne 2
889.na
890\fBzfs_vdev_max_active\fR (int)
891.ad
892.RS 12n
893The maximum number of I/Os active to each device. Ideally, this will be >=
894the sum of each queue's max_active. It must be at least the sum of each
895queue's min_active. See the section "ZFS I/O SCHEDULER".
896.sp
897Default value: \fB1,000\fR.
898.RE
899
900.sp
901.ne 2
902.na
903\fBzfs_vdev_scrub_max_active\fR (int)
904.ad
905.RS 12n
906Maxium scrub I/Os active to each device.
907See the section "ZFS I/O SCHEDULER".
908.sp
909Default value: \fB2\fR.
910.RE
911
912.sp
913.ne 2
914.na
915\fBzfs_vdev_scrub_min_active\fR (int)
916.ad
917.RS 12n
918Minimum scrub I/Os active to each device.
919See the section "ZFS I/O SCHEDULER".
920.sp
921Default value: \fB1\fR.
922.RE
923
924.sp
925.ne 2
926.na
927\fBzfs_vdev_sync_read_max_active\fR (int)
928.ad
929.RS 12n
930Maxium synchronous read I/Os active to each device.
931See the section "ZFS I/O SCHEDULER".
932.sp
933Default value: \fB10\fR.
934.RE
935
936.sp
937.ne 2
938.na
939\fBzfs_vdev_sync_read_min_active\fR (int)
940.ad
941.RS 12n
942Minimum synchronous read I/Os active to each device.
943See the section "ZFS I/O SCHEDULER".
944.sp
945Default value: \fB10\fR.
946.RE
947
948.sp
949.ne 2
950.na
951\fBzfs_vdev_sync_write_max_active\fR (int)
952.ad
953.RS 12n
954Maxium synchronous write I/Os active to each device.
955See the section "ZFS I/O SCHEDULER".
956.sp
957Default value: \fB10\fR.
958.RE
959
960.sp
961.ne 2
962.na
963\fBzfs_vdev_sync_write_min_active\fR (int)
964.ad
965.RS 12n
966Minimum synchronous write I/Os active to each device.
967See the section "ZFS I/O SCHEDULER".
968.sp
969Default value: \fB10\fR.
970.RE
971
29714574
TF
972.sp
973.ne 2
974.na
975\fBzfs_disable_dup_eviction\fR (int)
976.ad
977.RS 12n
978Disable duplicate buffer eviction
979.sp
980Use \fB1\fR for yes and \fB0\fR for no (default).
981.RE
982
983.sp
984.ne 2
985.na
986\fBzfs_expire_snapshot\fR (int)
987.ad
988.RS 12n
989Seconds to expire .zfs/snapshot
990.sp
991Default value: \fB300\fR.
992.RE
993
0500e835
BB
994.sp
995.ne 2
996.na
997\fBzfs_admin_snapshot\fR (int)
998.ad
999.RS 12n
1000Allow the creation, removal, or renaming of entries in the .zfs/snapshot
1001directory to cause the creation, destruction, or renaming of snapshots.
1002When enabled this functionality works both locally and over NFS exports
1003which have the 'no_root_squash' option set. This functionality is disabled
1004by default.
1005.sp
1006Use \fB1\fR for yes and \fB0\fR for no (default).
1007.RE
1008
29714574
TF
1009.sp
1010.ne 2
1011.na
1012\fBzfs_flags\fR (int)
1013.ad
1014.RS 12n
33b6dbbc
NB
1015Set additional debugging flags. The following flags may be bitwise-or'd
1016together.
1017.sp
1018.TS
1019box;
1020rB lB
1021lB lB
1022r l.
1023Value Symbolic Name
1024 Description
1025_
10261 ZFS_DEBUG_DPRINTF
1027 Enable dprintf entries in the debug log.
1028_
10292 ZFS_DEBUG_DBUF_VERIFY *
1030 Enable extra dbuf verifications.
1031_
10324 ZFS_DEBUG_DNODE_VERIFY *
1033 Enable extra dnode verifications.
1034_
10358 ZFS_DEBUG_SNAPNAMES
1036 Enable snapshot name verification.
1037_
103816 ZFS_DEBUG_MODIFY
1039 Check for illegally modified ARC buffers.
1040_
104132 ZFS_DEBUG_SPA
1042 Enable spa_dbgmsg entries in the debug log.
1043_
104464 ZFS_DEBUG_ZIO_FREE
1045 Enable verification of block frees.
1046_
1047128 ZFS_DEBUG_HISTOGRAM_VERIFY
1048 Enable extra spacemap histogram verifications.
1049.TE
1050.sp
1051* Requires debug build.
29714574 1052.sp
33b6dbbc 1053Default value: \fB0\fR.
29714574
TF
1054.RE
1055
fbeddd60
MA
1056.sp
1057.ne 2
1058.na
1059\fBzfs_free_leak_on_eio\fR (int)
1060.ad
1061.RS 12n
1062If destroy encounters an EIO while reading metadata (e.g. indirect
1063blocks), space referenced by the missing metadata can not be freed.
1064Normally this causes the background destroy to become "stalled", as
1065it is unable to make forward progress. While in this stalled state,
1066all remaining space to free from the error-encountering filesystem is
1067"temporarily leaked". Set this flag to cause it to ignore the EIO,
1068permanently leak the space from indirect blocks that can not be read,
1069and continue to free everything else that it can.
1070
1071The default, "stalling" behavior is useful if the storage partially
1072fails (i.e. some but not all i/os fail), and then later recovers. In
1073this case, we will be able to continue pool operations while it is
1074partially failed, and when it recovers, we can continue to free the
1075space, with no leaks. However, note that this case is actually
1076fairly rare.
1077
1078Typically pools either (a) fail completely (but perhaps temporarily,
1079e.g. a top-level vdev going offline), or (b) have localized,
1080permanent errors (e.g. disk returns the wrong data due to bit flip or
1081firmware bug). In case (a), this setting does not matter because the
1082pool will be suspended and the sync thread will not be able to make
1083forward progress regardless. In case (b), because the error is
1084permanent, the best we can do is leak the minimum amount of space,
1085which is what setting this flag will do. Therefore, it is reasonable
1086for this flag to normally be set, but we chose the more conservative
1087approach of not setting it, so that there is no possibility of
1088leaking space in the "partial temporary" failure case.
1089.sp
1090Default value: \fB0\fR.
1091.RE
1092
29714574
TF
1093.sp
1094.ne 2
1095.na
1096\fBzfs_free_min_time_ms\fR (int)
1097.ad
1098.RS 12n
1099Min millisecs to free per txg
1100.sp
1101Default value: \fB1,000\fR.
1102.RE
1103
1104.sp
1105.ne 2
1106.na
1107\fBzfs_immediate_write_sz\fR (long)
1108.ad
1109.RS 12n
1110Largest data block to write to zil
1111.sp
1112Default value: \fB32,768\fR.
1113.RE
1114
f1512ee6
MA
1115.sp
1116.ne 2
1117.na
1118\fBzfs_max_recordsize\fR (int)
1119.ad
1120.RS 12n
1121We currently support block sizes from 512 bytes to 16MB. The benefits of
1122larger blocks, and thus larger IO, need to be weighed against the cost of
1123COWing a giant block to modify one byte. Additionally, very large blocks
1124can have an impact on i/o latency, and also potentially on the memory
1125allocator. Therefore, we do not allow the recordsize to be set larger than
1126zfs_max_recordsize (default 1MB). Larger blocks can be created by changing
1127this tunable, and pools with larger blocks can always be imported and used,
1128regardless of this setting.
1129.sp
1130Default value: \fB1,048,576\fR.
1131.RE
1132
29714574
TF
1133.sp
1134.ne 2
1135.na
1136\fBzfs_mdcomp_disable\fR (int)
1137.ad
1138.RS 12n
1139Disable meta data compression
1140.sp
1141Use \fB1\fR for yes and \fB0\fR for no (default).
1142.RE
1143
f3a7f661
GW
1144.sp
1145.ne 2
1146.na
1147\fBzfs_metaslab_fragmentation_threshold\fR (int)
1148.ad
1149.RS 12n
1150Allow metaslabs to keep their active state as long as their fragmentation
1151percentage is less than or equal to this value. An active metaslab that
1152exceeds this threshold will no longer keep its active status allowing
1153better metaslabs to be selected.
1154.sp
1155Default value: \fB70\fR.
1156.RE
1157
1158.sp
1159.ne 2
1160.na
1161\fBzfs_mg_fragmentation_threshold\fR (int)
1162.ad
1163.RS 12n
1164Metaslab groups are considered eligible for allocations if their
1165fragmenation metric (measured as a percentage) is less than or equal to
1166this value. If a metaslab group exceeds this threshold then it will be
1167skipped unless all metaslab groups within the metaslab class have also
1168crossed this threshold.
1169.sp
1170Default value: \fB85\fR.
1171.RE
1172
f4a4046b
TC
1173.sp
1174.ne 2
1175.na
1176\fBzfs_mg_noalloc_threshold\fR (int)
1177.ad
1178.RS 12n
1179Defines a threshold at which metaslab groups should be eligible for
1180allocations. The value is expressed as a percentage of free space
1181beyond which a metaslab group is always eligible for allocations.
1182If a metaslab group's free space is less than or equal to the
6b4e21c6 1183threshold, the allocator will avoid allocating to that group
f4a4046b
TC
1184unless all groups in the pool have reached the threshold. Once all
1185groups have reached the threshold, all groups are allowed to accept
1186allocations. The default value of 0 disables the feature and causes
1187all metaslab groups to be eligible for allocations.
1188
1189This parameter allows to deal with pools having heavily imbalanced
1190vdevs such as would be the case when a new vdev has been added.
1191Setting the threshold to a non-zero percentage will stop allocations
1192from being made to vdevs that aren't filled to the specified percentage
1193and allow lesser filled vdevs to acquire more allocations than they
1194otherwise would under the old \fBzfs_mg_alloc_failures\fR facility.
1195.sp
1196Default value: \fB0\fR.
1197.RE
1198
29714574
TF
1199.sp
1200.ne 2
1201.na
1202\fBzfs_no_scrub_io\fR (int)
1203.ad
1204.RS 12n
1205Set for no scrub I/O
1206.sp
1207Use \fB1\fR for yes and \fB0\fR for no (default).
1208.RE
1209
1210.sp
1211.ne 2
1212.na
1213\fBzfs_no_scrub_prefetch\fR (int)
1214.ad
1215.RS 12n
1216Set for no scrub prefetching
1217.sp
1218Use \fB1\fR for yes and \fB0\fR for no (default).
1219.RE
1220
29714574
TF
1221.sp
1222.ne 2
1223.na
1224\fBzfs_nocacheflush\fR (int)
1225.ad
1226.RS 12n
1227Disable cache flushes
1228.sp
1229Use \fB1\fR for yes and \fB0\fR for no (default).
1230.RE
1231
1232.sp
1233.ne 2
1234.na
1235\fBzfs_nopwrite_enabled\fR (int)
1236.ad
1237.RS 12n
1238Enable NOP writes
1239.sp
1240Use \fB1\fR for yes (default) and \fB0\fR to disable.
1241.RE
1242
1243.sp
1244.ne 2
1245.na
b738bc5a 1246\fBzfs_pd_bytes_max\fR (int)
29714574
TF
1247.ad
1248.RS 12n
b738bc5a 1249The number of bytes which should be prefetched.
29714574 1250.sp
74aa2ba2 1251Default value: \fB52,428,800\fR.
29714574
TF
1252.RE
1253
1254.sp
1255.ne 2
1256.na
1257\fBzfs_prefetch_disable\fR (int)
1258.ad
1259.RS 12n
7f60329a
MA
1260This tunable disables predictive prefetch. Note that it leaves "prescient"
1261prefetch (e.g. prefetch for zfs send) intact. Unlike predictive prefetch,
1262prescient prefetch never issues i/os that end up not being needed, so it
1263can't hurt performance.
29714574
TF
1264.sp
1265Use \fB1\fR for yes and \fB0\fR for no (default).
1266.RE
1267
1268.sp
1269.ne 2
1270.na
1271\fBzfs_read_chunk_size\fR (long)
1272.ad
1273.RS 12n
1274Bytes to read per chunk
1275.sp
1276Default value: \fB1,048,576\fR.
1277.RE
1278
1279.sp
1280.ne 2
1281.na
1282\fBzfs_read_history\fR (int)
1283.ad
1284.RS 12n
1285Historic statistics for the last N reads
1286.sp
1287Default value: \fB0\fR.
1288.RE
1289
1290.sp
1291.ne 2
1292.na
1293\fBzfs_read_history_hits\fR (int)
1294.ad
1295.RS 12n
1296Include cache hits in read history
1297.sp
1298Use \fB1\fR for yes and \fB0\fR for no (default).
1299.RE
1300
1301.sp
1302.ne 2
1303.na
1304\fBzfs_recover\fR (int)
1305.ad
1306.RS 12n
1307Set to attempt to recover from fatal errors. This should only be used as a
1308last resort, as it typically results in leaked space, or worse.
1309.sp
1310Use \fB1\fR for yes and \fB0\fR for no (default).
1311.RE
1312
1313.sp
1314.ne 2
1315.na
1316\fBzfs_resilver_delay\fR (int)
1317.ad
1318.RS 12n
27b293be
TC
1319Number of ticks to delay prior to issuing a resilver I/O operation when
1320a non-resilver or non-scrub I/O operation has occurred within the past
1321\fBzfs_scan_idle\fR ticks.
29714574
TF
1322.sp
1323Default value: \fB2\fR.
1324.RE
1325
1326.sp
1327.ne 2
1328.na
1329\fBzfs_resilver_min_time_ms\fR (int)
1330.ad
1331.RS 12n
1332Min millisecs to resilver per txg
1333.sp
1334Default value: \fB3,000\fR.
1335.RE
1336
1337.sp
1338.ne 2
1339.na
1340\fBzfs_scan_idle\fR (int)
1341.ad
1342.RS 12n
27b293be
TC
1343Idle window in clock ticks. During a scrub or a resilver, if
1344a non-scrub or non-resilver I/O operation has occurred during this
1345window, the next scrub or resilver operation is delayed by, respectively
1346\fBzfs_scrub_delay\fR or \fBzfs_resilver_delay\fR ticks.
29714574
TF
1347.sp
1348Default value: \fB50\fR.
1349.RE
1350
1351.sp
1352.ne 2
1353.na
1354\fBzfs_scan_min_time_ms\fR (int)
1355.ad
1356.RS 12n
1357Min millisecs to scrub per txg
1358.sp
1359Default value: \fB1,000\fR.
1360.RE
1361
1362.sp
1363.ne 2
1364.na
1365\fBzfs_scrub_delay\fR (int)
1366.ad
1367.RS 12n
27b293be
TC
1368Number of ticks to delay prior to issuing a scrub I/O operation when
1369a non-scrub or non-resilver I/O operation has occurred within the past
1370\fBzfs_scan_idle\fR ticks.
29714574
TF
1371.sp
1372Default value: \fB4\fR.
1373.RE
1374
fd8febbd
TF
1375.sp
1376.ne 2
1377.na
1378\fBzfs_send_corrupt_data\fR (int)
1379.ad
1380.RS 12n
1381Allow to send corrupt data (ignore read/checksum errors when sending data)
1382.sp
1383Use \fB1\fR for yes and \fB0\fR for no (default).
1384.RE
1385
29714574
TF
1386.sp
1387.ne 2
1388.na
1389\fBzfs_sync_pass_deferred_free\fR (int)
1390.ad
1391.RS 12n
1392Defer frees starting in this pass
1393.sp
1394Default value: \fB2\fR.
1395.RE
1396
1397.sp
1398.ne 2
1399.na
1400\fBzfs_sync_pass_dont_compress\fR (int)
1401.ad
1402.RS 12n
1403Don't compress starting in this pass
1404.sp
1405Default value: \fB5\fR.
1406.RE
1407
1408.sp
1409.ne 2
1410.na
1411\fBzfs_sync_pass_rewrite\fR (int)
1412.ad
1413.RS 12n
1414Rewrite new bps starting in this pass
1415.sp
1416Default value: \fB2\fR.
1417.RE
1418
1419.sp
1420.ne 2
1421.na
1422\fBzfs_top_maxinflight\fR (int)
1423.ad
1424.RS 12n
27b293be 1425Max I/Os per top-level vdev during scrub or resilver operations.
29714574
TF
1426.sp
1427Default value: \fB32\fR.
1428.RE
1429
1430.sp
1431.ne 2
1432.na
1433\fBzfs_txg_history\fR (int)
1434.ad
1435.RS 12n
1436Historic statistics for the last N txgs
1437.sp
1438Default value: \fB0\fR.
1439.RE
1440
29714574
TF
1441.sp
1442.ne 2
1443.na
1444\fBzfs_txg_timeout\fR (int)
1445.ad
1446.RS 12n
1447Max seconds worth of delta per txg
1448.sp
1449Default value: \fB5\fR.
1450.RE
1451
1452.sp
1453.ne 2
1454.na
1455\fBzfs_vdev_aggregation_limit\fR (int)
1456.ad
1457.RS 12n
1458Max vdev I/O aggregation size
1459.sp
1460Default value: \fB131,072\fR.
1461.RE
1462
1463.sp
1464.ne 2
1465.na
1466\fBzfs_vdev_cache_bshift\fR (int)
1467.ad
1468.RS 12n
1469Shift size to inflate reads too
1470.sp
1471Default value: \fB16\fR.
1472.RE
1473
1474.sp
1475.ne 2
1476.na
1477\fBzfs_vdev_cache_max\fR (int)
1478.ad
1479.RS 12n
1480Inflate reads small than max
1481.RE
1482
1483.sp
1484.ne 2
1485.na
1486\fBzfs_vdev_cache_size\fR (int)
1487.ad
1488.RS 12n
1489Total size of the per-disk cache
1490.sp
1491Default value: \fB0\fR.
1492.RE
1493
29714574
TF
1494.sp
1495.ne 2
1496.na
1497\fBzfs_vdev_mirror_switch_us\fR (int)
1498.ad
1499.RS 12n
1500Switch mirrors every N usecs
1501.sp
1502Default value: \fB10,000\fR.
1503.RE
1504
29714574
TF
1505.sp
1506.ne 2
1507.na
1508\fBzfs_vdev_read_gap_limit\fR (int)
1509.ad
1510.RS 12n
1511Aggregate read I/O over gap
1512.sp
1513Default value: \fB32,768\fR.
1514.RE
1515
1516.sp
1517.ne 2
1518.na
1519\fBzfs_vdev_scheduler\fR (charp)
1520.ad
1521.RS 12n
1522I/O scheduler
1523.sp
1524Default value: \fBnoop\fR.
1525.RE
1526
29714574
TF
1527.sp
1528.ne 2
1529.na
1530\fBzfs_vdev_write_gap_limit\fR (int)
1531.ad
1532.RS 12n
1533Aggregate write I/O over gap
1534.sp
1535Default value: \fB4,096\fR.
1536.RE
1537
29714574
TF
1538.sp
1539.ne 2
1540.na
1541\fBzfs_zevent_cols\fR (int)
1542.ad
1543.RS 12n
1544Max event column width
1545.sp
1546Default value: \fB80\fR.
1547.RE
1548
1549.sp
1550.ne 2
1551.na
1552\fBzfs_zevent_console\fR (int)
1553.ad
1554.RS 12n
1555Log events to the console
1556.sp
1557Use \fB1\fR for yes and \fB0\fR for no (default).
1558.RE
1559
1560.sp
1561.ne 2
1562.na
1563\fBzfs_zevent_len_max\fR (int)
1564.ad
1565.RS 12n
1566Max event queue length
1567.sp
1568Default value: \fB0\fR.
1569.RE
1570
1571.sp
1572.ne 2
1573.na
1574\fBzil_replay_disable\fR (int)
1575.ad
1576.RS 12n
1577Disable intent logging replay
1578.sp
1579Use \fB1\fR for yes and \fB0\fR for no (default).
1580.RE
1581
1582.sp
1583.ne 2
1584.na
1585\fBzil_slog_limit\fR (ulong)
1586.ad
1587.RS 12n
1588Max commit bytes to separate log device
1589.sp
1590Default value: \fB1,048,576\fR.
1591.RE
1592
29714574
TF
1593.sp
1594.ne 2
1595.na
1596\fBzio_delay_max\fR (int)
1597.ad
1598.RS 12n
6b4e21c6 1599Max zio millisecond delay before posting event
29714574
TF
1600.sp
1601Default value: \fB30,000\fR.
1602.RE
1603
29714574
TF
1604.sp
1605.ne 2
1606.na
1607\fBzio_requeue_io_start_cut_in_line\fR (int)
1608.ad
1609.RS 12n
1610Prioritize requeued I/O
1611.sp
1612Default value: \fB0\fR.
1613.RE
1614
dcb6bed1
D
1615.sp
1616.ne 2
1617.na
1618\fBzio_taskq_batch_pct\fR (uint)
1619.ad
1620.RS 12n
1621Percentage of online CPUs (or CPU cores, etc) which will run a worker thread
1622for IO. These workers are responsible for IO work such as compression and
1623checksum calculations. Fractional number of CPUs will be rounded down.
1624.sp
1625The default value of 75 was chosen to avoid using all CPUs which can result in
1626latency issues and inconsistent application performance, especially when high
1627compression is enabled.
1628.sp
1629Default value: \fB75\fR.
1630.RE
1631
29714574
TF
1632.sp
1633.ne 2
1634.na
1635\fBzvol_inhibit_dev\fR (uint)
1636.ad
1637.RS 12n
1638Do not create zvol device nodes
1639.sp
1640Use \fB1\fR for yes and \fB0\fR for no (default).
1641.RE
1642
1643.sp
1644.ne 2
1645.na
1646\fBzvol_major\fR (uint)
1647.ad
1648.RS 12n
1649Major number for zvol device
1650.sp
1651Default value: \fB230\fR.
1652.RE
1653
1654.sp
1655.ne 2
1656.na
1657\fBzvol_max_discard_blocks\fR (ulong)
1658.ad
1659.RS 12n
1660Max number of blocks to discard at once
1661.sp
1662Default value: \fB16,384\fR.
1663.RE
1664
9965059a
BB
1665.sp
1666.ne 2
1667.na
1668\fBzvol_prefetch_bytes\fR (uint)
1669.ad
1670.RS 12n
1671When adding a zvol to the system prefetch \fBzvol_prefetch_bytes\fR
1672from the start and end of the volume. Prefetching these regions
1673of the volume is desirable because they are likely to be accessed
1674immediately by \fBblkid(8)\fR or by the kernel scanning for a partition
1675table.
1676.sp
1677Default value: \fB131,072\fR.
1678.RE
1679
e8b96c60
MA
1680.SH ZFS I/O SCHEDULER
1681ZFS issues I/O operations to leaf vdevs to satisfy and complete I/Os.
1682The I/O scheduler determines when and in what order those operations are
1683issued. The I/O scheduler divides operations into five I/O classes
1684prioritized in the following order: sync read, sync write, async read,
1685async write, and scrub/resilver. Each queue defines the minimum and
1686maximum number of concurrent operations that may be issued to the
1687device. In addition, the device has an aggregate maximum,
1688\fBzfs_vdev_max_active\fR. Note that the sum of the per-queue minimums
1689must not exceed the aggregate maximum. If the sum of the per-queue
1690maximums exceeds the aggregate maximum, then the number of active I/Os
1691may reach \fBzfs_vdev_max_active\fR, in which case no further I/Os will
1692be issued regardless of whether all per-queue minimums have been met.
1693.sp
1694For many physical devices, throughput increases with the number of
1695concurrent operations, but latency typically suffers. Further, physical
1696devices typically have a limit at which more concurrent operations have no
1697effect on throughput or can actually cause it to decrease.
1698.sp
1699The scheduler selects the next operation to issue by first looking for an
1700I/O class whose minimum has not been satisfied. Once all are satisfied and
1701the aggregate maximum has not been hit, the scheduler looks for classes
1702whose maximum has not been satisfied. Iteration through the I/O classes is
1703done in the order specified above. No further operations are issued if the
1704aggregate maximum number of concurrent operations has been hit or if there
1705are no operations queued for an I/O class that has not hit its maximum.
1706Every time an I/O is queued or an operation completes, the I/O scheduler
1707looks for new operations to issue.
1708.sp
1709In general, smaller max_active's will lead to lower latency of synchronous
1710operations. Larger max_active's may lead to higher overall throughput,
1711depending on underlying storage.
1712.sp
1713The ratio of the queues' max_actives determines the balance of performance
1714between reads, writes, and scrubs. E.g., increasing
1715\fBzfs_vdev_scrub_max_active\fR will cause the scrub or resilver to complete
1716more quickly, but reads and writes to have higher latency and lower throughput.
1717.sp
1718All I/O classes have a fixed maximum number of outstanding operations
1719except for the async write class. Asynchronous writes represent the data
1720that is committed to stable storage during the syncing stage for
1721transaction groups. Transaction groups enter the syncing state
1722periodically so the number of queued async writes will quickly burst up
1723and then bleed down to zero. Rather than servicing them as quickly as
1724possible, the I/O scheduler changes the maximum number of active async
1725write I/Os according to the amount of dirty data in the pool. Since
1726both throughput and latency typically increase with the number of
1727concurrent operations issued to physical devices, reducing the
1728burstiness in the number of concurrent operations also stabilizes the
1729response time of operations from other -- and in particular synchronous
1730-- queues. In broad strokes, the I/O scheduler will issue more
1731concurrent operations from the async write queue as there's more dirty
1732data in the pool.
1733.sp
1734Async Writes
1735.sp
1736The number of concurrent operations issued for the async write I/O class
1737follows a piece-wise linear function defined by a few adjustable points.
1738.nf
1739
1740 | o---------| <-- zfs_vdev_async_write_max_active
1741 ^ | /^ |
1742 | | / | |
1743active | / | |
1744 I/O | / | |
1745count | / | |
1746 | / | |
1747 |-------o | | <-- zfs_vdev_async_write_min_active
1748 0|_______^______|_________|
1749 0% | | 100% of zfs_dirty_data_max
1750 | |
1751 | `-- zfs_vdev_async_write_active_max_dirty_percent
1752 `--------- zfs_vdev_async_write_active_min_dirty_percent
1753
1754.fi
1755Until the amount of dirty data exceeds a minimum percentage of the dirty
1756data allowed in the pool, the I/O scheduler will limit the number of
1757concurrent operations to the minimum. As that threshold is crossed, the
1758number of concurrent operations issued increases linearly to the maximum at
1759the specified maximum percentage of the dirty data allowed in the pool.
1760.sp
1761Ideally, the amount of dirty data on a busy pool will stay in the sloped
1762part of the function between \fBzfs_vdev_async_write_active_min_dirty_percent\fR
1763and \fBzfs_vdev_async_write_active_max_dirty_percent\fR. If it exceeds the
1764maximum percentage, this indicates that the rate of incoming data is
1765greater than the rate that the backend storage can handle. In this case, we
1766must further throttle incoming writes, as described in the next section.
1767
1768.SH ZFS TRANSACTION DELAY
1769We delay transactions when we've determined that the backend storage
1770isn't able to accommodate the rate of incoming writes.
1771.sp
1772If there is already a transaction waiting, we delay relative to when
1773that transaction will finish waiting. This way the calculated delay time
1774is independent of the number of threads concurrently executing
1775transactions.
1776.sp
1777If we are the only waiter, wait relative to when the transaction
1778started, rather than the current time. This credits the transaction for
1779"time already served", e.g. reading indirect blocks.
1780.sp
1781The minimum time for a transaction to take is calculated as:
1782.nf
1783 min_time = zfs_delay_scale * (dirty - min) / (max - dirty)
1784 min_time is then capped at 100 milliseconds.
1785.fi
1786.sp
1787The delay has two degrees of freedom that can be adjusted via tunables. The
1788percentage of dirty data at which we start to delay is defined by
1789\fBzfs_delay_min_dirty_percent\fR. This should typically be at or above
1790\fBzfs_vdev_async_write_active_max_dirty_percent\fR so that we only start to
1791delay after writing at full speed has failed to keep up with the incoming write
1792rate. The scale of the curve is defined by \fBzfs_delay_scale\fR. Roughly speaking,
1793this variable determines the amount of delay at the midpoint of the curve.
1794.sp
1795.nf
1796delay
1797 10ms +-------------------------------------------------------------*+
1798 | *|
1799 9ms + *+
1800 | *|
1801 8ms + *+
1802 | * |
1803 7ms + * +
1804 | * |
1805 6ms + * +
1806 | * |
1807 5ms + * +
1808 | * |
1809 4ms + * +
1810 | * |
1811 3ms + * +
1812 | * |
1813 2ms + (midpoint) * +
1814 | | ** |
1815 1ms + v *** +
1816 | zfs_delay_scale ----------> ******** |
1817 0 +-------------------------------------*********----------------+
1818 0% <- zfs_dirty_data_max -> 100%
1819.fi
1820.sp
1821Note that since the delay is added to the outstanding time remaining on the
1822most recent transaction, the delay is effectively the inverse of IOPS.
1823Here the midpoint of 500us translates to 2000 IOPS. The shape of the curve
1824was chosen such that small changes in the amount of accumulated dirty data
1825in the first 3/4 of the curve yield relatively small differences in the
1826amount of delay.
1827.sp
1828The effects can be easier to understand when the amount of delay is
1829represented on a log scale:
1830.sp
1831.nf
1832delay
1833100ms +-------------------------------------------------------------++
1834 + +
1835 | |
1836 + *+
1837 10ms + *+
1838 + ** +
1839 | (midpoint) ** |
1840 + | ** +
1841 1ms + v **** +
1842 + zfs_delay_scale ----------> ***** +
1843 | **** |
1844 + **** +
1845100us + ** +
1846 + * +
1847 | * |
1848 + * +
1849 10us + * +
1850 + +
1851 | |
1852 + +
1853 +--------------------------------------------------------------+
1854 0% <- zfs_dirty_data_max -> 100%
1855.fi
1856.sp
1857Note here that only as the amount of dirty data approaches its limit does
1858the delay start to increase rapidly. The goal of a properly tuned system
1859should be to keep the amount of dirty data out of that range by first
1860ensuring that the appropriate limits are set for the I/O scheduler to reach
1861optimal throughput on the backend storage, and then by changing the value
1862of \fBzfs_delay_scale\fR to increase the steepness of the curve.