Module Parameters
Note
Most of this page is generated from the OpenZFS sources: the list
of parameters, their types, defaults and one-line descriptions
come from the code and the man pages of each release. The tuning
advice is written by hand in docs/module_parameters.yaml.
If anything here is wrong, outdated or missing, please report it.
Most OpenZFS kernel module parameters are accessible in the SysFS
/sys/module/zfs/parameters directory. Current values can be observed
by
cat /sys/module/zfs/parameters/PARAMETER
Many of these can be changed by writing new values. These are denoted by
Change: Dynamic in the parameter details below.
echo NEWVALUE >> /sys/module/zfs/parameters/PARAMETER
If the parameter is not dynamically adjustable, an error can occur and the value will not be set. It can be helpful to check the permissions for the PARAMETER file in SysFS.
In some cases, the parameter must be set prior to loading the kernel
modules or it is desired to have the parameters set automatically at
boot time. For many distros, this can be accomplished by creating a file
named /etc/modprobe.d/zfs.conf containing a text line for each
module parameter using the format:
# change PARAMETER for workload XZY to solve problem PROBLEM_DESCRIPTION
# changed by YOUR_NAME on DATE
options zfs PARAMETER=VALUE
Some parameters related to ZFS operations are located in module
parameters other than in the zfs kernel module. For example, the
icp kernel module parameters are visible in the
/sys/module/icp/parameters directory and can be set by default at
boot time by changing the /etc/modprobe.d/icp.conf file.
See the man page for modprobe.d for more information.
On FreeBSD the same tunables are exposed as sysctls under the vfs.zfs
tree, for example sysctl vfs.zfs.arc.max, and can be set at boot time
from /boot/loader.conf.
To observe the list of parameters supported by the modules you actually
have installed, along with a short synopsis of each, use the modinfo
command:
modinfo zfs
Manual pages
The zfs(4) and
spl(4) man pages (previously
zfs- and spl-module-parameters(5), respectively, prior to
OpenZFS 2.1) are the authoritative description of the module parameters
and are shipped with the version of OpenZFS you run.
This page is generated from the same sources for every supported release, and adds the information that the man pages do not carry: which versions a parameter exists in, how its default changed between them, and the accumulated advice of ZFS developers and practitioners about when to change it.
Use the selector above to restrict the page to the parameters that exist in a particular OpenZFS release, and the box next to it to narrow the list down by name. Leave the selector at All versions to search the full history, including parameters that have since been removed.
Parameters
brt_zap_default_bs
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.4 - master
13v2.2 - v2.3
12- Change:
Dynamic
- Tags:
BRT ZAP leaf blockshift
brt_zap_default_ibs
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.4 - master
13v2.2 - v2.3
12- Change:
Dynamic
- Tags:
BRT ZAP indirect blockshift
brt_zap_prefetch
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Enable prefetching of BRT ZAP entries
dbuf_cache_hiwater_pct
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Change:
Dynamic
- Tags:
Percentage over dbuf_cache_max_bytes for direct dbuf eviction.
When to change: Testing dbuf cache algorithms
Notes: The dbuf_cache_hiwater_pct and dbuf_cache_lowater_pct define the operating range for dbuf cache evict thread. The hiwater and lowater are percentages of the dbuf_cache_max_bytes value. When the dbuf cache grows above ((100% + dbuf_cache_hiwater_pct) * dbuf_cache_max_bytes) then the dbuf cache thread begins evicting. When the dbug cache falls below ((100% - dbuf_cache_lowater_pct) * dbuf_cache_max_bytes) then the dbuf cache thread stops evicting.
dbuf_cache_lowater_pct
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Change:
Dynamic
- Tags:
Percentage below dbuf_cache_max_bytes when dbuf eviction stops.
When to change: Testing dbuf cache algorithms
Notes: The dbuf_cache_hiwater_pct and dbuf_cache_lowater_pct define the operating range for dbuf cache evict thread. The hiwater and lowater are percentages of the dbuf_cache_max_bytes value. When the dbuf cache grows above ((100% + dbuf_cache_hiwater_pct) * dbuf_cache_max_bytes) then the dbuf cache thread begins evicting. When the dbug cache falls below ((100% - dbuf_cache_lowater_pct) * dbuf_cache_max_bytes) then the dbuf cache thread stops evicting.
dbuf_cache_max_bytes
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.2 - master
UINT64_MAXv2.0 - v2.1
ULONG_MAXv0.8
0- Range:
0 = use dbuf_cache_shift to ARC
c_max- Change:
Dynamic
- Tags:
Maximum size in bytes of the dbuf cache.
Notes: dbuf_cache_max_bytes sets the size of the dbuf cache in bytes. This is an alternate method for setting dbuf cache size than dbuf_cache_shift Performance tuning of dbuf cache can be monitored using: - dbufstat command - node_exporter ZFS module for prometheus environments - telegraf ZFS plugin for general-purpose metric collection - /proc/spl/kstat/zfs/dbufstats kstat
dbuf_cache_max_shift
- Versions:
v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Range:
1 to 63
- Change:
Dynamic
- Tags:
Cap the size of the dbuf cache to a log2 fraction of arc size.
When to change: Testing dbuf cache algorithms
Notes: The dbuf_cache_max_bytes minimum is the lesser of dbuf_cache_max_bytes and the current ARC target size (c) >> dbuf_cache_max_shift
dbuf_cache_shift
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
5- Range:
5 to MAX_INT
- Change:
Dynamic
- Tags:
Set size of dbuf cache to log2 fraction of arc size.
When to change: to improve performance of read-intensive channel programs
Notes: dbuf_cache_shift sets the size of the dbuf cache as a fraction of ARC target size. This is an alternate method for setting dbuf cache size than dbuf_cache_max_bytes. dbuf_cache_max_bytes overrides dbuf_cache_shift This value is a “shift” representing the fraction of ARC target size (grep -w c /proc/spl/kstat/zfs/arcstats). The ARC target size is shifted to the right. Thus a value of ‘2’ results in the fraction = 1/4, while a value of ‘5’ results in the fraction = 1/32. Performance tuning of dbuf cache can be monitored using: - dbufstat command - node_exporter ZFS module for prometheus environments - telegraf ZFS plugin for general-purpose metric collection - /proc/spl/kstat/zfs/dbufstats kstat
dbuf_metadata_cache_max_bytes
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.2 - master
UINT64_MAXv2.0 - v2.1
ULONG_MAXv0.8
0- Range:
0 = use dbuf_metadata_cache_shift to ARC
c_max- Change:
Dynamic
- Tags:
Maximum size in bytes of dbuf metadata cache.
Notes: dbuf_metadata_cache_max_bytes sets the size of the dbuf metadata cache as a number of bytes. This is an alternate method for setting dbuf metadata cache size than dbuf_metadata_cache_shift dbuf_metadata_cache_max_bytes overrides dbuf_metadata_cache_shift
dbuf_metadata_cache_shift
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
6- Range:
practical range is ( dbuf_cache_shift + 1) to MAX_INT
- Change:
Dynamic
- Tags:
Set size of dbuf metadata cache to log2 fraction of arc size.
Notes: dbuf_metadata_cache_shift sets the size of the dbuf metadata cache as a fraction of ARC target size. This is an alternate method for setting dbuf metadata cache size than dbuf_metadata_cache_max_bytes. dbuf_metadata_cache_max_bytes overrides dbuf_metadata_cache_shift This value is a “shift” representing the fraction of ARC target size (grep -w c /proc/spl/kstat/zfs/arcstats). The ARC target size is shifted to the right. Thus a value of ‘2’ results in the fraction = 1/4, while a value of ‘6’ results in the fraction = 1/64.
dbuf_mutex_cache_shift
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Change:
Prior to module load
- Tags:
Set size of dbuf cache mutex array as log2 shift.
ddt_zap_default_bs
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
15- Change:
Dynamic
- Tags:
DDT ZAP leaf blockshift
ddt_zap_default_ibs
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
15- Change:
Dynamic
- Tags:
DDT ZAP indirect blockshift
dmu_ddt_copies
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
3- Change:
Dynamic
- Tags:
Override copies= for dedup objects
dmu_object_alloc_chunk_shift
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
7- Range:
7 to 9
- Change:
Dynamic
- Tags:
CPU-specific allocator grabs 2^N objects at once
When to change: If the workload creates many files concurrently on a system with many CPUs, then increasing dmu_object_alloc_chunk_shift can decrease lock contention
Notes: Each of the concurrent object allocators grabs 2^dmu_object_alloc_chunk_shift dnode slots at a time. The default is to grab 128 slots, or 4 blocks worth. This default value was experimentally determined to be the lowest value that eliminates the measurable effect of lock contention in the DMU object allocation code path.
dmu_prefetch_max
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
134217728- Change:
Dynamic
- Tags:
Limit one prefetch call to this size
icp_aes_impl
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Range:
varies by hardware
- Change:
Dynamic
- Tags:
Select aes implementation.
When to change: debugging ZFS encryption on hardware
Notes: By default, ZFS will choose the highest performance, hardware-optimized implementation of the AES encryption algorithm. The icp_aes_impl tunable overrides this automatic choice. Note: icp_aes_impl is set in the icp kernel module, not the zfs kernel module. To observe the available options cat /sys/module/icp/parameters/icp_aes_impl The default option is shown in brackets ‘[]’
icp_gcm_avx_chunk_size
How many bytes to process while owning the FPU
icp_gcm_impl
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Range:
varies by hardware
- Change:
Dynamic
- Tags:
encryption, gcm, ICP
Select gcm implementation.
When to change: debugging ZFS encryption on hardware
Notes: By default, ZFS will choose the highest performance, hardware-optimized implementation of the GCM encryption algorithm. The icp_gcm_impl tunable overrides this automatic choice. Note: icp_gcm_impl is set in the icp kernel module, not the zfs kernel module. To observe the available options cat /sys/module/icp/parameters/icp_gcm_impl The default option is shown in brackets ‘[]’
ignore_hole_birth
- Versions:
v0.7 - v2.2
- Platforms:
Linux, FreeBSD
- Type:
int- Range:
0disabled
1enabled
- Change:
Dynamic
- Tags:
Alias for send_holes_without_birth_time
When to change: Enable if you suspect your datasets are affected by a bug in hole_birth during zfs send operations
Notes: Renamed to send_holes_without_birth_time in v2.4.0 (commit 284580c87). When set, the hole_birth optimization will not be used and all holes will always be sent by zfs send.
l2arc_dwpd_limit
L2ARC device endurance limit as percentage (100 = 1.0 DWPD)
l2arc_exclude_special
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0disabled
1enabled
- Change:
Dynamic
- Tags:
Exclude dbufs on special vdevs from being cached to L2ARC if set.
When to change: If cache and special devices exist and caching data on special devices in L2ARC is not desired
l2arc_ext_headroom_pct
Depth cap as percentage of state size for marker reset
l2arc_feed_again
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0disabled
1enabled
- Change:
Dynamic
- Tags:
Turbo L2ARC warmup
When to change: If cache devices exist and it is desired to fill them as fast as possible
Notes: Turbo L2ARC cache warm-up. When the L2ARC is cold the fill interval will be set to aggressively fill as fast as possible.
l2arc_feed_min_ms
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
200- Range:
0 to (1000 * l2arc_feed_secs)
- Change:
Dynamic
- Tags:
Min feed interval in milliseconds
When to change: If cache devices exist and l2arc_feed_again and the feed is too aggressive, then this tunable can be adjusted to reduce the impact of the fill
Notes: Minimum time period for aggressively feeding the L2ARC. The L2ARC feed thread wakes up once per second (see l2arc_feed_secs) to look for data to feed into the L2ARC. l2arc_feed_min_ms only affects the turbo L2ARC cache warm-up and allows the aggressiveness to be adjusted.
l2arc_feed_secs
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1- Range:
1 to UINT64_MAX
- Change:
Dynamic
- Tags:
Seconds between L2ARC writing
When to change: Do not change
Notes: Seconds between waking the L2ARC feed thread. One feed thread works for all cache devices in turn. If the pool that owns a cache device is imported readonly, then the feed thread is delayed 5 * l2arc_feed_secs before moving onto the next cache device. If multiple pools are imported with cache devices and one pool with cache is imported readonly, the L2ARC feed rate to all caches can be slowed.
l2arc_headroom
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.2 - master
8v0.6 - v2.1
2- Change:
Dynamic
- Tags:
Number of max device writes to precache
When to change: If the rate of change in the ARC is faster than the overall L2ARC feed rate, then increasing l2arc_headroom can increase L2ARC efficiency. Setting the value too large can cause the L2ARC feed thread to consume more CPU time looking for data to feed. Setting to 0 disables the headroom limit, allowing the full length of ARC lists to be searched for cacheable content.
Notes: How far through the ARC lists to search for L2ARC cacheable content, expressed as a multiplier of l2arc_write_max
l2arc_headroom_boost
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
200- Range:
100 to UINT64_MAX, when set to 100, the L2ARC headroom boost feature is effectively disabled
- Change:
Dynamic
- Tags:
Compressed l2arc_headroom multiplier
When to change: If average compression efficiency is greater than 2:1, then increasing l2arc_headroom_boost can increase the L2ARC feed rate
Notes: Percentage scale for l2arc_headroom when L2ARC contents are being successfully compressed before writing.
l2arc_meta_cycles
Consecutive metadata cycles before skipping to let data run
l2arc_meta_percent
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
33- Range:
0 to 100
- Change:
Dynamic
- Tags:
Percent of ARC size allowed for L2ARC-only headers
When to change: When workload really require enormous L2ARC.
Notes: Percent of ARC size allowed for L2ARC-only headers. Since L2ARC buffers are not evicted on memory pressure, too large amount of headers on system with irrationally large L2ARC can render it slow or unusable. This parameter limits L2ARC writes and rebuild to achieve it.
l2arc_mfuonly
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0store MRU and MFU blocks in cache device
1store MFU blocks in cache device
- Change:
Dynamic
- Tags:
Cache only MFU data from ARC into L2ARC
When to change: When accessing a large amount of data only once.
Notes: Controls whether only MFU metadata and data are cached from ARC into L2ARC. This may be desirable to avoid wasting space on L2ARC when reading/writing large amounts of data that are not expected to be accessed more than once. By default both MRU and MFU data and metadata are cached in the L2ARC.
l2arc_nocompress
- Versions:
v0.6
- Platforms:
Linux, FreeBSD
- Type:
int- Range:
0store compressed blocks in cache device
1store uncompressed blocks in cache device
- Change:
Dynamic
- Tags:
Skip compressing L2ARC buffers
When to change: When testing compressed L2ARC feature
Notes: Removed in v0.7.0 by commit d3c2ae1c0 (“OpenZFS 6950 - ARC should cache compressed data”). The ARC now always caches compressed data, making this toggle unnecessary. No replacement parameter. Disable writing compressed data to cache devices. Disabling allows the legacy behavior of writing decompressed data to cache devices.
l2arc_noprefetch
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0write prefetched but unused buffers to cache devices
1do not write prefetched but unused buffers to cache devices
- Change:
Dynamic
- Tags:
Skip caching prefetched buffers
When to change: Setting to 0 can increase L2ARC hit rates for workloads where the ARC is too small for a read workload that benefits from prefetching. Also, if the main pool devices are very slow, setting to 0 can improve some workloads such as backups.
l2arc_norw
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0read and write simultaneously
1avoid writes when reading for antique SSDs
- Change:
Dynamic
- Tags:
No reads during writes
When to change: In the early days of SSDs, some devices did not perform well when reading and writing simultaneously. Modern SSDs do not have these issues.
Notes: Disables writing to cache devices while they are being read.
l2arc_rebuild_blocks_min_l2size
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1073741824- Change:
Dynamic
- Tags:
Min size in bytes to write rebuild log blocks in L2ARC
When to change: The cache device is small and the pool is frequently imported.
Notes: The minimum required size (in bytes) of an L2ARC device in order to write log blocks in it. The log blocks are used upon importing the pool to rebuild the persistent L2ARC. For L2ARC devices less than 1GB the overhead involved offsets most of benefit so log blocks are not written for cache devices smaller than this.
l2arc_rebuild_enabled
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0disable persistent L2ARC rebuild
1enable persistent L2ARC rebuild
- Change:
Dynamic
- Tags:
Rebuild the L2ARC when importing a pool
When to change: If there are problems importing a pool or attaching an L2ARC device.
l2arc_trim_ahead
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
0- Range:
0 to 100
- Change:
Dynamic
- Tags:
TRIM ahead L2ARC write size multiplier
When to change: Consider setting for cache devices which efficiently handle TRIM commands.
Notes: Once the cache device has been filled TRIM ahead of the current write size l2arc_write_max on L2ARC devices by this percentage. This can speed up future writes depending on the performance characteristics of the cache device. When set to 100% TRIM twice the space required to accommodate upcoming writes. A minimum of 64MB will be trimmed. If set it enables TRIM of the whole L2ARC device when it is added to a pool. By default, this option is disabled since it can put significant stress on the underlying storage devices.
l2arc_write_boost
- Versions:
v0.6 - v2.4
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.2 - v2.4
33554432v0.6 - v2.1
8,388,608- Change:
Dynamic
- Tags:
Extra write bytes during device warmup
When to change: To fill the cache devices more aggressively after pool import.
Notes: Until the ARC fills, increases the L2ARC fill rate l2arc_write_max by l2arc_write_boost.
l2arc_write_max
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.2 - master
33554432v0.6 - v2.1
8,388,608- Range:
1 to UINT64_MAX
- Change:
Dynamic
- Tags:
Max write bytes per interval
When to change: If the cache devices can sustain the write workload, increasing the rate of cache device fill when workloads generate new data at a rate higher than l2arc_write_max can increase L2ARC hit rate
Notes: Maximum number of bytes to be written to each cache device for each L2ARC feed thread interval (see l2arc_feed_secs). Until v2.4 the limit could be raised during warmup by l2arc_write_boost, which has since been removed. By default l2arc_feed_secs is 1 second, delivering a maximum write workload to cache devices of 32 MiB/sec.
metaslab_aliquot
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.4 - master
2097152v2.1 - v2.3
1048576v0.6 - v2.0
524,288- Change:
Dynamic
- Tags:
Allocation granularity (a.k.a. stripe size)
When to change: If write performance increases as devices more efficiently write larger, contiguous blocks
Notes: Sets the metaslab granularity. Nominally, ZFS will try to allocate this amount of data to a top-level vdev before moving on to the next top-level vdev. This is roughly similar to what would be referred to as the “stripe size” in traditional RAID arrays. When tuning for HDDs, it can be more efficient to have a few larger, sequential writes to a device rather than switching to the next device. Monitoring the size of contiguous writes to the disks relative to the write throughput can be used to determine if increasing metaslab_aliquot can help. For modern devices, it is unlikely that decreasing metaslab_aliquot from the default will help. If there is only one top-level vdev, this tunable is not used.
metaslab_bias_enabled
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0spread evenly across top-level vdevs
1bias spread to favor less full top-level vdevs
- Change:
Dynamic
- Tags:
Enable space-based metaslab group biasing
When to change: If a new top-level vdev is added and you do not want to bias new allocations to the new top-level vdev
Notes: Enables metaslab group biasing based on a top-level vdev’s utilization relative to the pool. Nominally, all top-level devs are the same size and the allocation is spread evenly. When the top-level vdevs are not of the same size, for example if a new (empty) top-level is added to the pool, this allows the new top-level vdev to get a larger portion of new allocations.
metaslab_debug_load
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0do not load all metaslab info at pool import
1dynamically load metaslab info as needed
- Change:
Dynamic
- Tags:
Load all metaslabs when pool is first opened
When to change: When RAM is plentiful and pool import time is not a consideration
Notes: When enabled, all metaslabs are loaded into memory during pool import. Nominally, metaslab space map information is loaded and unloaded as needed (see metaslab_debug_unload) It is difficult to predict how much RAM is required to store a space map. An empty or completely full metaslab has a small space map. However, a highly fragmented space map can consume significantly more memory. Enabling metaslab_debug_load can increase pool import time.
metaslab_debug_unload
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0dynamically unload metaslab info
1unload metaslab info only upon pool export
- Change:
Dynamic
- Tags:
Prevent metaslabs from being unloaded
When to change: When RAM is plentiful and the penalty for dynamically reloading metaslab info from the pool is high
Notes: When enabled, prevents metaslab information from being dynamically unloaded from RAM. Nominally, metaslab space map information is loaded and unloaded as needed (see metaslab_debug_load) It is difficult to predict how much RAM is required to store a space map. An empty or completely full metaslab has a small space map. However, a highly fragmented space map can consume significantly more memory. Enabling metaslab_debug_unload consumes RAM that would otherwise be freed.
metaslab_df_alloc_threshold
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
131072- Change:
Dynamic
- Tags:
Minimum size which forces the dynamic allocator to change its allocation strategy
metaslab_df_free_pct
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
4- Change:
Dynamic
- Tags:
The minimum free space, in percent, to continue allocations in a first-fit fashion
metaslab_df_max_search
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
16777216- Change:
Dynamic
- Tags:
Max distance (bytes) to search forward before using size tree
metaslab_df_use_largest_segment
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
When looking in size tree, use largest segment instead of exact fit
metaslab_force_ganging
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
16777217- Range:
SPA_MINBLOCKSIZE to (SPA_MAXBLOCKSIZE + 1)
- Change:
Dynamic
- Tags:
Blocks larger than this size are sometimes forced to be gang blocks
When to change: for development testing purposes only
Notes: When testing allocation code, metaslab_force_ganging forces blocks above the specified size to be ganged.
metaslab_force_ganging_pct
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
3- Change:
Dynamic
- Tags:
Percentage of large blocks that will be forced to be gang blocks
metaslab_fragmentation_factor_enabled
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not consider metaslab free space fragmentation
1try to avoid fragmented metaslabs
- Change:
Dynamic
- Tags:
Use the fragmentation metric to prefer less fragmented metaslabs
When to change: To test metaslab fragmentation
Notes: Enable use of the fragmentation metric in computing metaslab weights. In version v0.7.0, if zfs_metaslab_segment_weight_enabled is enabled, then metaslab_fragmentation_factor_enabled is ignored.
metaslab_lba_weighting_enabled
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not use LBA weighting
1use LBA weighting
- Change:
Dynamic
- Tags:
allocation, HDD, metaslab, SSD
Prefer metaslabs with lower LBAs
When to change: disable if using only SSDs and version v0.6.4 or earlier
Verification: The rotational setting described by a block device in sysfs by observing /sys/ block/DISK_NAME/queue/rotational
Notes: Modern HDDs have uniform bit density and constant angular velocity. Therefore, the outer recording zones are faster (higher bandwidth) than the inner zones by the ratio of outer to inner track diameter. The difference in bandwidth can be 2:1, and is often available in the HDD detailed specifications or drive manual. For HDDs when metaslab_lba_weighting_enabled is true, write allocation preference is given to the metaslabs representing the outer recording zones. Thus the allocation to metaslabs prefers faster bandwidth over free space. If the devices are not rotational, yet misrepresent themselves to the OS as rotational, then disabling metaslab_lba_weighting_enabled can result in more even, free-space-based allocation.
metaslab_perf_bias
- Versions:
v2.4 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Enable performance-based metaslab group biasing
metaslab_preload_enabled
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not preload metaslab info
1preload up to 3 metaslabs
- Change:
Dynamic
- Tags:
Preload potential metaslabs during reassessment
When to change: When testing metaslab allocation
Notes: Enable metaslab group preloading. Each top-level vdev has a metaslab group. By default, up to 3 copies of metadata can exist and are distributed across multiple top-level vdevs. metaslab_preload_enabled allows the corresponding metaslabs to be preloaded, thus improving allocation efficiency.
metaslab_preload_limit
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Change:
Dynamic
- Tags:
Max number of metaslabs per group to preload
metaslab_preload_pct
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
50- Change:
Dynamic
- Tags:
Percentage of CPUs to run a metaslab preload taskq
metaslab_trace_enabled
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
int- Change:
Dynamic
- Tags:
Enable metaslab allocation tracing
metaslab_trace_max_entries
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
u64- Change:
Dynamic
- Tags:
Maximum entries for metaslab allocation tracing
metaslab_unload_delay
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
32- Change:
Dynamic
- Tags:
Delay in txgs after metaslab was last used before unloading
metaslab_unload_delay_ms
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
600000- Change:
Dynamic
- Tags:
Delay in milliseconds after metaslab was last used before unloading
metaslabs_per_vdev
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
200- Range:
16 to UINT64_MAX
- Change:
Dynamic
- Tags:
Divide added vdev into approximately (but no more than) this number of metaslabs
When to change: When testing metaslab allocation
raidz_expand_max_copy_bytes
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
160MB- Change:
Dynamic
- Tags:
Max amount of concurrent i/o for RAIDZ expansion
raidz_expand_max_reflow_bytes
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
0- Change:
Dynamic
- Tags:
For testing, pause RAIDZ expansion after reflowing this many bytes
raidz_io_aggregate_rows
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
4- Change:
Dynamic
- Tags:
For expanded RAIDZ, aggregate reads that have more rows than this
reference_history
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
3- Change:
Dynamic
- Tags:
Maximum reference holders being tracked
reference_tracking_enable
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Track reference holders to refcount_t objects
send_holes_without_birth_time
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Ignore hole_birth txg for zfs send
Notes: Renamed from ignore_hole_birth in v2.4.0.
spa_asize_inflation
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
24- Range:
1 to 24
- Change:
Dynamic
- Tags:
SPA size estimate multiplication factor
When to change: If the allocation requirements for the workload are well known and quotas are used
Notes: Multiplication factor used to estimate actual disk consumption from the size of data being written. The default value is a worst case estimate, but lower values may be valid for a given pool depending on its configuration. Pool administrators who understand the factors involved may wish to specify a more realistic inflation factor, particularly if they operate close to quota or capacity limits. The worst case space requirement for allocation is single-sector max-parity RAIDZ blocks, in which case the space requirement is exactly 4 times the size, accounting for a maximum of 3 parity blocks. This is added to the maximum number of ZFS copies parameter (copies max=3). Additional space is required if the block could impact deduplication tables. Altogether, the worst case is 24. If the estimation is not correct, then quotas or out-of-space conditions can lead to optimistic expectations of the ability to allocate. Applications are typically not prepared to deal with such failures and can misbehave.
spa_config_path
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
string- Change:
Prior to module load
- Tags:
SPA config file (/etc/zfs/zpool.cache)
When to change: If creating a non-standard distribution and the cachefile property is inconvenient
Notes: By default, the zpool import command searches for pool information in the zpool.cache file. If the pool to be imported has an entry in zpool.cache then the devices do not have to be scanned to determine if they are pool members. The path to the cache file is spa_config_path. For more information on zpool import and the -o cachefile and -d options, see the man page for zpool(8) See also zfs_autoimport_disable (removed after v2.3)
spa_cpus_per_allocator
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
4- Change:
Dynamic
- Tags:
Minimum number of CPUs per allocators
spa_flush_txg_time
- Versions:
v2.4 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Change:
Dynamic
- Tags:
How frequently the TXG timestamps database should be flushed to disk (in seconds)
spa_load_print_vdev_tree
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0do not print pool configuration in logs
1print pool configuration in logs
- Change:
Dynamic
- Tags:
Print vdev tree to zfs_dbgmsg during pool import
When to change: troubleshooting pool import failures
Notes: spa_load_print_vdev_tree enables printing of the attempted pool import’s vdev tree to kernel message to the ZFS debug message log /proc/spl/kstat/zfs/dbgmsg Both the provided vdev tree and MOS vdev tree are printed, which can be useful for debugging problems with the zpool cachefile
spa_load_verify_data
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not verify data upon pool import
1verify pool data upon import
- Change:
Dynamic
- Tags:
Set to traverse data on pool import
When to change: At the risk of data integrity, to speed extreme import of large pool
Notes: An extreme rewind import (see zpool import -X) normally performs a full traversal of all blocks in the pool for verification. If this parameter is set to 0, the traversal skips non-metadata blocks. It can be toggled once the import has started to stop or start the traversal of non-metadata blocks. See also spa_load_verify_metadata.
spa_load_verify_maxinflight
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
10000- Range:
1 to MAX_INT
- Change:
Dynamic
- Tags:
Max concurrent traversal I/Os while verifying pool during import -X
When to change: During an extreme rewind import, to match the concurrent I/O capabilities of the pool devices
Notes: Maximum number of concurrent I/Os during the data verification performed during an extreme rewind import (see zpool import -X)
spa_load_verify_metadata
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not verify metadata upon pool import
1verify pool metadata upon import
- Change:
Dynamic
- Tags:
Set to traverse metadata on pool import
When to change: At the risk of data integrity, to speed extreme import of large pool
Notes: An extreme rewind import (see zpool import -X) normally performs a full traversal of all blocks in the pool for verification. If this parameter is set to 0, the traversal is not performed. It can be toggled once the import has started to stop or start the traversal. See spa_load_verify_data
spa_load_verify_shift
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
4- Range:
1 to MAX_INT
- Change:
Dynamic
- Tags:
log2 fraction of arc that can be used by inflight I/Os when verifying pool during import
When to change: troubleshooting pool import on large memory machines
Notes: spa_load_verify_shift sets the fraction of ARC that can be used by inflight I/Os when verifying the pool during import. This value is a “shift” representing the fraction of ARC target size (grep -w c /proc/spl/kstat/zfs/arcstats). The ARC target size is shifted to the right. Thus a value of ‘2’ results in the fraction = 1/4, while a value of ‘4’ results in the fraction = 1/8. For large memory machines, pool import can consume large amounts of ARC: much larger than the value of maxinflight. This can result in spa_load_verify_maxinflight (removed after v0.7) having a value of 0 causing the system to hang. Setting spa_load_verify_shift can reduce this limit and allow importing without hanging.
spa_note_txg_time
- Versions:
v2.4 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Change:
Dynamic
- Tags:
How frequently TXG timestamps are stored internally (in seconds)
spa_num_allocators
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
4- Change:
Dynamic
- Tags:
Number of allocators per spa
spa_slop_shift
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
5- Range:
1 to MAX_INT, however the practical upper limit is 15 for a system with 4TB of RAM
- Change:
Dynamic
- Tags:
Reserved free space in pool
When to change: For large pools, when 3.2% may be too conservative and more usable space is desired, consider increasing spa_slop_shift
Notes: Normally, the last 3.2% (1/(2^spa_slop_shift)) of pool space is reserved to ensure the pool doesn’t run completely out of space, due to unaccounted changes (e.g. to the MOS). This also limits the worst-case time to allocate space. When less than this amount of free space exists, most ZPL operations (e.g. write, create) return error:no space (ENOSPC). Changing spa_slop_shift affects the currently loaded ZFS module and all imported pools. spa_slop_shift is not stored on disk. Beware when importing full pools on systems with larger spa_slop_shift can lead to over-full conditions. The minimum SPA slop space is limited to 128 MiB. The maximum SPA slop space is limited to 128 GiB.
spa_upgrade_errlog_limit
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Change:
Dynamic
- Tags:
Limit the number of errors which will be upgraded to the new on-disk error log when enabling head_errlog
spl_hostid
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
ulong- Default:
0- Range:
0=ignore hostid, 1 to 4,294,967,295 (32-bits or 0xffffffff)
- Change:
Dynamic
- Tags:
The system hostid.
When to change: to uniquely identify a system when vdevs can be shared across multiple systems
Notes: spl_hostid is a unique system id number. It originated in Sun’s products where most systems had a unique id assigned at the factory. This assignment does not exist in modern hardware. In ZFS, the hostid is stored in the vdev label and can be used to determine if another system had imported the pool. When set spl_hostid can be used to uniquely identify a system. By default this value is set to zero which indicates the hostid is disabled. It can be explicitly enabled by placing a unique non-zero value in the file shown in spl_hostid_path
spl_hostid_path
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
charp- Change:
Prior to module load
- Tags:
The system hostid file (/etc/hostid)
When to change: when creating a new ZFS distribution where the default value is inappropriate
Notes: spl_hostid_path is the path name for a file that can contain a unique hostid. For testing purposes, spl_hostid_path can be overridden by the ZFS_HOSTID environment variable.
spl_kmem_alloc_max
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
uint- Default:
v2.1 - master
KMALLOC_MAX_SIZEv0.8 - v2.0
KMALLOC_MAX_SIZE/4- Change:
Dynamic
- Tags:
Maximum size in bytes for a kmem_alloc()
Notes: Large kmem_alloc() allocations fail if they exceed KMALLOC_MAX_SIZE, as determined by the kernel source. Allocations which are marginally smaller than this limit may succeed but should still be avoided due to the expense of locating a contiguous range of free pages. Therefore, a maximum kmem size with reasonable safely margin of 4x is set. kmem_alloc() allocations larger than this maximum will quickly fail. vmem_alloc() allocations less than or equal to this value will use kmalloc(), but shift to vmalloc() when exceeding this value.
spl_kmem_alloc_warn
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
uint- Default:
32768- Range:
0=disable the warnings,
- Change:
Dynamic
- Tags:
Warning threshold in bytes for a kmem_alloc()
When to change: developers are encouraged lower when testing so any new, large allocations are quickly caught
Notes: As a general rule kmem_alloc() allocations should be small, preferably just a few pages since they must by physically contiguous. Therefore, a rate limited warning is printed to the console for any kmem_alloc() which exceeds the threshold spl_kmem_alloc_warn The default warning threshold is set to eight pages but capped at 32K to accommodate systems using large pages. This value was selected to be small enough to ensure the largest allocations are quickly noticed and fixed. But large enough to avoid logging any warnings when a allocation size is larger than optimal but not a serious concern. Since this value is tunable, developers are encouraged to set it lower when testing so any new largish allocations are quickly caught. These warnings may be disabled by setting the threshold to zero.
spl_kmem_cache_expire
- Versions:
v0.8
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0x02- Range:
0x01 - Aging (illumos), 0x02 - Low memory (Linux)
- Change:
Dynamic
- Tags:
kmem, kmem_cache, memory, SPL
By age (0x1) or low memory (0x2)
Notes: Cache expiration is part of default illumos cache behavior. The idea is that objects in magazines which have not been recently accessed should be returned to the slabs periodically. This is known as cache aging and when enabled objects will be typically returned after 15 seconds. On the other hand Linux slabs are designed to never move objects back to the slabs unless there is memory pressure. This is possible because under Linux the cache will be notified when memory is low and objects can be released. By default only the Linux method is enabled. It has been shown to improve responsiveness on low memory systems and not negatively impact the performance of systems with more memory. This policy may be changed by setting the spl_kmem_cache_expire bit mask as follows, both policies may be enabled concurrently.
spl_kmem_cache_kmem_limit
- Versions:
v0.8
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
PAGE_SIZE/4- Change:
Dynamic
- Tags:
kmem, kmem_cache, memory, SPL
Objects less than N bytes use the kmalloc
Notes: Depending on the size of a memory cache object it may be backed by kmalloc() or vmalloc() memory. This is because the size of the required allocation greatly impacts the best way to allocate the memory. When objects are small and only a small number of memory pages need to be allocated, ideally just one, then kmalloc() is very efficient. However, allocating multiple pages with kmalloc() gets increasingly expensive because the pages must be physically contiguous. For this reason we shift to vmalloc() for slabs of large objects which which removes the need for contiguous pages. vmalloc() cannot be used in all cases because there is significant locking overhead involved. This function takes a single global lock over the entire virtual address range which serializes all allocations. Using slightly different allocation functions for small and large objects allows us to handle a wide range of object sizes. The spl_kmem_cache_kmem_limit value is used to determine this cutoff size. One quarter of the kernel’s compiled PAGE_SIZE is used as the default value because spl_kmem_cache_obj_per_slab defaults to 8. With these default values, at most two contiguous pages are allocated.
spl_kmem_cache_kmem_threads
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
uint- Default:
4- Range:
1 to MAX_INT
- Change:
Prior to module load
- Tags:
CPU, kmem, kmem_cache, memory, SPL
Number of spl_kmem_cache threads
When to change: read-only
Notes: spl_kmem_cache_kmem_threads shows the current number of spl_kmem_cache threads. This task queue is responsible for allocating new slabs for use by the kmem caches. For the majority of systems and workloads only a small number of threads are required.
spl_kmem_cache_magazine_size
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
uint- Default:
0- Range:
0=automatically scale magazine size, otherwise 2 to 256
- Change:
Prior to module load
- Tags:
CPU, kmem, kmem_cache, memory, SPL
Default magazine size (2-256), set automatically (0)
Notes: spl_kmem_cache_magazine_size shows the current . Cache magazines are an optimization designed to minimize the cost of allocating memory. They do this by keeping a per-cpu cache of recently freed objects, which can then be reallocated without taking a lock. This can improve performance on highly contended caches. However, because objects in magazines will prevent otherwise empty slabs from being immediately released this may not be ideal for low memory machines. For this reason spl_kmem_cache_magazine_size can be used to set a maximum magazine size. When this value is set to 0 the magazine size will be automatically determined based on the object size. Otherwise magazines will be limited to 2-256 objects per magazine (eg per CPU). Magazines cannot be disabled entirely in this implementation.
spl_kmem_cache_max_size
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
uint- Default:
32- Change:
Dynamic
- Tags:
kmem, kmem_cache, memory, SPL
Maximum size of slab in MB
Notes: spl_kmem_cache_max_size is the maximum size of a kmem cache slab in MiB. This effectively limits the maximum cache object size to spl_kmem_cache_max_size / spl_kmem_cache_obj_per_slab Kmem caches may not be created with object sized larger than this limit.
spl_kmem_cache_obj_per_slab
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
uint- Default:
8- Change:
Dynamic
- Tags:
kmem, kmem_cache, memory, SPL
Number of objects per slab
Notes: spl_kmem_cache_obj_per_slab is the preferred number of objects per slab in the kmem cache. In general, a larger value will increase the caches memory footprint while decreasing the time required to perform an allocation. Conversely, a smaller value will minimize the footprint and improve cache reclaim time but individual allocations may take longer.
spl_kmem_cache_obj_per_slab_min
- Versions:
v0.8
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Change:
Dynamic
- Tags:
kmem, kmem_cache, memory, SPL
Minimal number of objects per slab
When to change: debugging kmem cache operations
Notes: spl_kmem_cache_obj_per_slab_min is the minimum number of objects allowed per slab. Normally slabs will contain spl_kmem_cache_obj_per_slab objects but for caches that contain very large objects it’s desirable to only have a few, or even just one, object per slab.
spl_kmem_cache_reclaim
- Versions:
v0.8 - v2.1
- Platforms:
Linux
- Type:
uint- Default:
0- Range:
0enable rapid memory reclaim from kmem caches
1disable rapid memory reclaim from kmem caches
- Change:
Dynamic
- Tags:
kmem, kmem_cache, memory, SPL
Single reclaim pass (0x1)
Notes: spl_kmem_cache_reclaim prevents Linux from being able to rapidly reclaim all the memory held by the kmem caches. This may be useful in circumstances where it’s preferable that Linux reclaim memory from some other subsystem first. Setting spl_kmem_cache_reclaim increases the likelihood out of memory events on a memory constrained system.
spl_kmem_cache_slab_limit
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
uint- Default:
16384- Change:
Dynamic
- Tags:
kmem, kmem_cache, memory, SPL
Objects less than N bytes use the Linux slab
Notes: For small objects the Linux slab allocator should be used to make the most efficient use of the memory. However, large objects are not supported by the Linux slab allocator and therefore the SPL implementation is preferred. spl_kmem_cache_slab_limit is used to determine the cutoff between a small and large object. Objects of spl_kmem_cache_slab_limit or smaller will be allocated using the Linux slab allocator, large objects use the SPL allocator. A cutoff of 16 KiB was determined to be optimal for architectures using 4 KiB pages.
spl_max_show_tasks
- Versions:
v0.8 - v2.2
- Platforms:
Linux
- Type:
uint- Default:
512- Range:
0 disables the limit, 1 to MAX_UINT
- Change:
Dynamic
- Tags:
Max number of tasks shown in taskq proc
Notes: spl_max_show_tasks is the limit of tasks per pending list in each taskq shown in /proc/spl/taskq and /proc/spl/taskq-all. Reading the ProcFS files walks the lists with lock held and it could cause a lock up if the list grow too large. If the list is larger than the limit, the string "(truncated)" is printed.
spl_panic_halt
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
uint- Default:
0- Range:
0halt thread upon assertion
1panic kernel upon assertion
- Change:
Dynamic
- Tags:
Cause kernel panic on assertion failures
When to change: when debugging assertions and kernel core dumps are desired
Notes: spl_panic_halt enables kernel panic upon assertion failures. When not enabled, the asserting thread is halted to facilitate further debugging.
spl_schedule_hrtimeout_slack_us
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
uint- Default:
0- Change:
Dynamic
- Tags:
schedule_hrtimeout_range() delta/slack value in us, default(0)
spl_taskq_kick
Write nonzero to kick stuck taskqs to spawn more threads
When to change: See description above
Notes: Upon writing a non-zero value to spl_taskq_kick, all taskqs are scanned. If any taskq has a pending task more than 5 seconds old, the taskq spawns more threads. This can be useful in rare deadlock situations caused by one or more taskqs not spawning a thread when it should.
spl_taskq_thread_bind
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
int- Default:
0- Range:
0taskqs are not bound to specific CPUs
1taskqs are bound to CPUs
- Change:
Dynamic
- Tags:
Bind taskq thread to CPU by default
When to change: when debugging CPU scheduling options
Notes: spl_taskq_thread_bind enables binding taskq threads to specific CPUs, distributed evenly over the available CPUs. By default, this behavior is disabled to allow the Linux scheduler the maximum flexibility to determine where a thread should run.
spl_taskq_thread_dynamic
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
int- Default:
1- Range:
0taskq threads are not dynamic
1taskq threads are dynamically created and destroyed
- Change:
Prior to module load
- Tags:
Allow dynamic taskq threads
When to change: disable for performance analysis or troubleshooting
Notes: spl_taskq_thread_dynamic enables taskqs to set the TASKQ_DYNAMIC flag will by default create only a single thread. New threads will be created on demand up to a maximum allowed number to facilitate the completion of outstanding tasks. Threads which are no longer needed are promptly destroyed. By default this behavior is enabled but it can be d. See also zfs_zil_clean_taskq_nthr_pct, zio_taskq_batch_pct
spl_taskq_thread_priority
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
int- Default:
1- Range:
0taskq threads use the default Linux kernel thread priority
1- Change:
Dynamic
- Tags:
Allow non-default priority for taskq threads
When to change: when troubleshooting CPU scheduling-related performance issues
Notes: spl_taskq_thread_priority allows newly created taskq threads to set a non-default scheduler priority. When enabled the priority specified when a taskq is created will be applied to all threads created by that taskq. When disabled all threads will use the default Linux kernel thread priority.
spl_taskq_thread_sequential
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
uint- Default:
4- Range:
1 to MAX_INT
- Change:
Dynamic
- Tags:
Create new taskq threads after N sequential tasks
Notes: spl_taskq_thread_sequential is the number of items a taskq worker thread must handle without interruption before requesting a new worker thread be spawned. spl_taskq_thread_sequential controls how quickly taskqs ramp up the number of threads processing the queue. Because Linux thread creation and destruction are relatively inexpensive a small default value has been selected. Thus threads are created aggressively, which is typically desirable. Increasing this value results in a slower thread creation rate which may be preferable for some configurations.
spl_taskq_thread_timeout_ms
Minimum idle threads exit interval for dynamic taskqs
vdev_file_logical_ashift
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
9- Change:
Dynamic
- Tags:
Logical ashift for file-based devices
vdev_file_physical_ashift
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
9- Change:
Dynamic
- Tags:
Physical ashift for file-based devices
vdev_raidz_outlier_check_interval_ms
- Versions:
v2.4 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1000- Change:
Dynamic
- Tags:
Interval to check for slow raidz/draid children
vdev_raidz_outlier_insensitivity
- Versions:
v2.4 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
50- Change:
Dynamic
- Tags:
How insensitive the slow raidz/draid child check should be
vdev_read_sit_out_secs
- Versions:
v2.4 - master
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
600- Change:
Dynamic
- Tags:
Raidz/draid slow disk sit out time period in seconds
vdev_removal_max_span
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
32768- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Largest span of free chunks a remap segment can span
Notes: During top-level vdev removal, chunks of data are copied from the vdev which may include free space in order to trade bandwidth for IOPS. vdev_removal_max_span sets the maximum span of free space included as unnecessary data in a chunk of copied data.
vdev_validate_skip
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0validate labels during pool import
1do not validate vdev labels during pool import
- Change:
Dynamic
- Tags:
Bypass vdev_validate()
When to change: do not change
Notes: vdev_validate_skip disables label validation steps during pool import. Changing is not recommended unless you know what you are doing and are recovering a damaged label.
zap_iterate_prefetch
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
When iterating ZAP object, prefetch it
zap_micro_max_size
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
131072- Change:
Dynamic
- Tags:
Maximum micro ZAP size before converting to a fat ZAP, in bytes (max 1M)
zap_shrink_enabled
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Enable ZAP shrinking
zfetch_array_rd_sz
- Versions:
v0.6 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
1048576- Range:
0 to MAX_ULONG
- Change:
Dynamic
- Tags:
Number of bytes in a array_read
When to change: To allow prefetching when using large block sizes
Notes: If prefetching is enabled, do not prefetch blocks larger than zfetch_array_rd_sz size.
zfetch_block_cap
- Versions:
v0.6
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
256- Change:
Dynamic
- Tags:
Max number of blocks to fetch at a time
zfetch_hole_shift
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
2- Change:
Dynamic
- Tags:
Max log2 fraction of holes in a stream
zfetch_max_distance
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.1 - master
67108864v0.7 - v2.0
8,388,608- Change:
Dynamic
- Tags:
Max bytes to prefetch per stream
When to change: Consider increasing read workloads that use large blocks and exhibit high prefetch hit ratios
zfetch_max_idistance
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
67108864- Change:
Dynamic
- Tags:
Max bytes to prefetch indirects for per stream
zfetch_max_reorder
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
16777216- Change:
Dynamic
- Tags:
Max request reorder distance within a stream
zfetch_max_sec_reap
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
2- Change:
Dynamic
- Tags:
Max time before stream delete
zfetch_max_streams
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
8- Range:
1 to MAX_UINT
- Change:
Dynamic
- Tags:
Max number of streams per zfetch
When to change: If the workload benefits from prefetching and has more than zfetch_max_streams concurrent reader threads
Notes: Maximum number of prefetch streams per file. For version v0.7.0 and later, when prefetching small files the number of prefetch streams is automatically reduced below to prevent the streams from overlapping.
zfetch_min_distance
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
4194304- Change:
Dynamic
- Tags:
Min bytes to prefetch per stream
zfetch_min_sec_reap
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.1 - master
1v0.6 - v2.0
2- Range:
0 to MAX_UINT
- Change:
Dynamic
- Tags:
Min time before stream reclaim
When to change: To test prefetch efficiency
Notes: Prefetch streams that have been accessed in zfetch_min_sec_reap seconds are automatically stopped.
zfs_abd_scatter_enabled
- Versions:
v0.7 - master
- Platforms:
Linux
- Type:
int- Default:
1- Range:
0use linear allocation only
1allow scatter/gather
- Change:
Dynamic
- Tags:
Toggle whether ABD allocations must be linear.
When to change: Testing ABD
Verification: ABD statistics are observable in /proc/spl/kstat/zfs/abdstats. Slab allocations are observable in /proc/slabinfo
Notes: zfs_abd_scatter_enabled controls the ARC Buffer Data (ABD) scatter/gather feature. When disabled, the legacy behaviour is selected using linear buffers. For linear buffers, all the data in the ABD is stored in one contiguous buffer in memory (from a zio_[data_]buf_* kmem cache). When enabled (default), the data in the ABD is split into equal-sized chunks (from the abd_chunk_cache kmem_cache), with pointers to the chunks recorded in an array at the end of the ABD structure. This allows more efficient memory allocation for buffers, especially when large recordsizes are used.
zfs_abd_scatter_max_order
- Versions:
v0.7 - master
- Platforms:
Linux
- Type:
uint- Default:
v2.1 - master
MAX_ORDER-1v2.0
10 at the time of this writing- Range:
1 to 10 (upper limit is hardware-dependent)
- Change:
Dynamic
- Tags:
Maximum order allocation used for a scatter ABD.
When to change: Testing ABD features
Verification: ABD statistics are observable in /proc/spl/kstat/zfs/abdstats
Notes: zfs_abd_scatter_max_order sets the maximum order for physical page allocation when ABD is enabled (see zfs_abd_scatter_enabled) See also Buddy Memory Allocation in the Linux kernel documentation.
zfs_abd_scatter_min_size
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
int- Default:
1536- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Minimum size of scatter allocations.
When to change: debugging memory allocation, especially for large pages
Notes: zfs_abd_scatter_min_size changes the ARC buffer data (ABD) allocator’s threshold for using linear or page-based scatter buffers. Allocations smaller than zfs_abd_scatter_min_size use linear ABDs. Scatter ABD’s use at least one page each, so sub-page allocations waste some space when allocated as scatter allocations. For example, 2KB scatter allocation wastes half of each page. Using linear ABD’s for small allocations results in slabs containing many allocations. This can improve memory efficiency, at the expense of more work for ARC evictions attempting to free pages, because all the buffers on one slab need to be freed in order to free the slab and its underlying pages. Typically, 512B and 1KB kmem caches have 16 buffers per slab, so it’s possible for them to actually waste more memory than scatter allocations: - one page per buf = wasting 3/4 or 7/8 - one buf per slab = wasting 15/16 Spill blocks are typically 512B and are heavily used on systems running selinux with the default dnode size and the xattr=sa property set. By default, linear allocations for 512B and 1KB, and scatter allocations for larger (>= 1.5KB) allocation requests.
zfs_active_allocator
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
charp- Default:
dynamic- Change:
Dynamic
- Tags:
SPA active allocator
zfs_admin_snapshot
- Versions:
v0.6 - master
- Platforms:
Linux
- Type:
int- Default:
0- Range:
0do not allow snapshot manipulation via the filesystem
1allow snapshot manipulation via the filesystem
- Change:
Dynamic
- Tags:
Enable mkdir/rmdir/mv in .zfs/snapshot
Notes: Allow the creation, removal, or renaming of entries in the .zfs/snapshot subdirectory to cause the creation, destruction, or renaming of snapshots. When enabled this functionality works both locally and over NFS exports which have the “no_root_squash” option set.
zfs_allow_redacted_dataset_mount
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Allow mounting of redacted datasets
zfs_arc_average_blocksize
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
8192- Range:
512 to 16,777,216
- Change:
Prior to module load
- Tags:
Target average block size
When to change: For workloads where the known average blocksize is larger, increasing zfs_arc_average_blocksize can reduce memory usage
Notes: The ARC’s buffer hash table is sized based on the assumption of an average block size of zfs_arc_average_blocksize. The default of 8 KiB uses approximately 1 MiB of hash table per 1 GiB of physical memory with 8-byte pointers.
zfs_arc_dnode_limit
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
0- Change:
Dynamic
- Tags:
Minimum bytes of dnodes in ARC
When to change: Consider increasing if arc_prune is using excessive system time and /proc/spl/kstat/zfs/arcstats shows arc_dnode_size is near or over arc_dnode_limit
Notes: When the number of bytes consumed by dnodes in the ARC exceeds zfs_arc_dnode_limit bytes, demand for new metadata can take from the space consumed by dnodes. The default value 0, indicates that a percent which is based on zfs_arc_dnode_limit_percent of the ARC meta buffers that may be used for dnodes.
zfs_arc_dnode_limit_percent
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
10- Range:
0 to 100
- Change:
Dynamic
- Tags:
Percent of ARC meta buffers for dnodes
When to change: Consider increasing if arc_prune is using excessive system time and /proc/spl/kstat/zfs/arcstats shows arc_dnode_size is near or over arc_dnode_limit
Notes: Percentage of ARC metadata space that can be used for dnodes. The value calculated for zfs_arc_dnode_limit_percent can be overridden by zfs_arc_dnode_limit.
zfs_arc_dnode_reduce_percent
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Range:
0 to 100
- Change:
Dynamic
- Tags:
Percentage of excess dnodes to try to unpin
When to change: Testing dnode cache efficiency
Notes: Percentage of ARC dnodes to try to evict in response to demand for non-metadata when the number of bytes consumed by dnodes exceeds zfs_arc_dnode_limit.
zfs_arc_evict_batch_limit
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Range:
1 to INT_MAX
- Change:
Dynamic
- Tags:
The number of headers to evict per sublist before moving to the next
When to change: Testing ARC multilist features
Notes: Number ARC headers to evict per sublist before proceeding to another sublist. This batch-style operation prevents entire sublists from being evicted at once but comes at a cost of additional unlocking and locking.
zfs_arc_evict_batches_limit
- Versions:
v2.4 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
5- Change:
Dynamic
- Tags:
The number of batches to run per parallel eviction task
zfs_arc_evict_threads
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Change:
Prior to module load
- Tags:
Number of threads to use for ARC eviction.
zfs_arc_eviction_pct
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
200- Change:
Dynamic
- Tags:
When full, ARC allocation waits for eviction of this % of alloc size
zfs_arc_free_target
Desired number of free pages below which ARC triggers reclaim
When to change: When the ARC is not releasing memory fast enough to keep up with other system demands
Notes: zfs_arc_free_target is the desired number of free pages below which the ARC triggers reclaim. Initialized at boot to the kernel’s vm.v_free_target value. This parameter is FreeBSD-specific and uses pages as its unit, unlike zfs_arc_sys_free which is measured in bytes.
zfs_arc_grow_retry
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v0.7 - master
0v0.6
5- Range:
0=use the built-in default of 5 seconds, otherwise 1 to INT_MAX
- Change:
Dynamic
- Tags:
Seconds before growing ARC size
Notes: When the ARC is shrunk due to memory demand, do not retry growing the ARC for zfs_arc_grow_retry seconds. This operates as a damper to prevent oscillating grow/shrink cycles when there is memory pressure. If zfs_arc_grow_retry = 0, the internal default of 5 seconds is used.
zfs_arc_lotsfree_percent
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
10- Range:
0 to 100
- Change:
Dynamic
- Tags:
System free memory I/O throttle in bytes
Notes: Throttle ARC memory consumption, effectively throttling I/O, when free system memory drops below this percentage of total system memory. Setting zfs_arc_lotsfree_percent to 0 disables the throttle. The arcstat_memory_throttle_count counter in /proc/spl/kstat/arcstats can indicate throttle activity.
zfs_arc_max
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
0- Range:
67,108,864 to RAM size in bytes
- Change:
Dynamic
- Tags:
Maximum ARC size in bytes
When to change: Reduce if ARC competes too much with other applications, increase if ZFS is the primary application and can use more RAM
Verification: c column of zarcstat (arcstat before 2.4.0) or /proc/spl/kstat/zfs/arcstats entry c_max
Notes:
If set to 0, the limit is derived from the amount of memory installed.
Since v2.3.0 every platform uses the larger of
all_system_memory - 1 GiB and 5/8 x all_system_memory. Before
that the platforms differed:
Linux: half of system memory
FreeBSD: the larger of
all_system_memory - 1 GiBand5/8 x all_system_memory
zfs_arc_max can be changed dynamically, with some caveats. It cannot
be set back to 0 while running, and reducing it below the current ARC
size will not cause the ARC to shrink without memory pressure to induce
shrinking.
zfs_arc_meta_adjust_restarts
- Versions:
v0.6 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
4096- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
Limit number of restarts in arc_evict_meta
When to change: Testing ARC metadata adjustment feature
Notes: Removed in v2.2.0 by commit a8d83e2a (“More adaptive ARC eviction”). Replaced by adaptive eviction with zfs_arc_meta_balance. The number of restart passes to make while scanning the ARC attempting the free buffers in order to stay below the zfs_arc_meta_limit.
zfs_arc_meta_balance
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
500- Change:
Dynamic
- Tags:
Balance between metadata and data on ghost hits.
When to change: When the ARC is not caching enough metadata (or too much) for your workload
Notes: zfs_arc_meta_balance controls how the ARC balances metadata and data caching. When evicted metadata is re-requested (a “ghost hit”), the ARC shifts its target to cache more metadata. This parameter scales the strength of that shift relative to data ghost hits. Higher values give more preference to metadata. The default of 500 means metadata ghost hits have 5x the effect of data ghost hits. A value of 100 weights them equally. This parameter replaced the manual metadata limit tunables (zfs_arc_meta_limit, zfs_arc_meta_min, etc.) that were removed in v2.2.0.
zfs_arc_meta_limit
- Versions:
v0.6 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
0- Range:
0 to
c_max- Change:
Dynamic
- Tags:
Metadata limit for arc size
When to change: For workloads where the metadata to data ratio in the ARC can be changed to improve ARC hit rates
Verification: /proc/spl/kstat/zfs/arcstats entry arc_meta_limit
Notes: Removed in v2.2.0 by commit a8d83e2a (“More adaptive ARC eviction”). Replaced by adaptive eviction with zfs_arc_meta_balance. Sets the maximum allowed size metadata buffers in the ARC. When zfs_arc_meta_limit is reached metadata buffers are reclaimed, even if the overall c_max has not been reached. In version v0.7.0, with a default value = 0, zfs_arc_meta_limit_percent is used to set arc_meta_limit
zfs_arc_meta_limit_percent
- Versions:
v0.7 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
75- Range:
0 to 100
- Change:
Dynamic
- Tags:
Percent of arc size for arc meta limit
When to change: For workloads where the metadata to data ratio in the ARC can be changed to improve ARC hit rates
Verification: /proc/spl/kstat/zfs/arcstats entry arc_meta_limit
Notes: Removed in v2.2.0 by commit a8d83e2a (“More adaptive ARC eviction”). Replaced by adaptive eviction with zfs_arc_meta_balance. Sets the limit to ARC metadata, arc_meta_limit, as a percentage of the maximum size target of the ARC, c_max Prior to version v0.7.0, the zfs_arc_meta_limit was used to set the limit as a fixed size. zfs_arc_meta_limit_percent provides a more convenient interface for setting the limit.
zfs_arc_meta_min
- Versions:
v0.6 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
0- Range:
16,777,216 to
c_max- Change:
Dynamic
- Tags:
Min arc metadata
Verification: /proc/spl/kstat/zfs/arcstats entry arc_meta_min
Notes: Removed in v2.2.0 by commit a8d83e2a (“More adaptive ARC eviction”). Replaced by adaptive eviction with zfs_arc_meta_balance. The minimum allowed size in bytes that metadata buffers may consume in the ARC. This value defaults to 0 which disables a floor on the amount of the ARC devoted meta data. When evicting data from the ARC, if the metadata_size is less than arc_meta_min then data is evicted instead of metadata.
zfs_arc_meta_prune
- Versions:
v0.6 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
10000- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
Meta objects to scan for prune
Notes: Removed in v2.2.0 by commit a8d83e2a (“More adaptive ARC eviction”). Replaced by adaptive eviction with zfs_arc_meta_balance. zfs_arc_meta_prune sets the number of dentries and znodes to be scanned looking for entries which can be dropped. This provides a mechanism to ensure the ARC can honor the arc_meta_limit and reclaim otherwise pinned ARC buffers. Pruning may be required when the ARC size drops to arc_meta_limit because dentries and znodes can pin buffers in the ARC. Increasing this value will cause to dentry and znode caches to be pruned more aggressively and the arc_prune thread becomes more active. Setting zfs_arc_meta_prune to 0 will disable pruning.
zfs_arc_meta_strategy
- Versions:
v0.6 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0evict metadata only
1also evict data buffers if they can free metadata buffers for eviction
- Change:
Dynamic
- Tags:
Meta reclaim strategy
When to change: Testing ARC metadata eviction
Notes: Removed in v2.2.0 by commit a8d83e2a (“More adaptive ARC eviction”). Replaced by adaptive eviction with zfs_arc_meta_balance. Defines the strategy for ARC metadata eviction (meta reclaim strategy). A value of 0 (META_ONLY) will evict only the ARC metadata. A value of 1 (BALANCED) indicates that additional data may be evicted if required in order to evict the requested amount of metadata.
zfs_arc_min
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v0.7 - master
0v0.6
100- Range:
33,554,432 to
c_max- Change:
Dynamic
- Tags:
Minimum ARC size in bytes
When to change: If the primary focus of the system is ZFS, then increasing can ensure the ARC gets a minimum amount of RAM
Verification: /proc/spl/kstat/zfs/arcstats entry c_min
Notes: Minimum ARC size limit. When the ARC is asked to shrink, it will stop shrinking at c_min as tuned by zfs_arc_min.
zfs_arc_min_prefetch_lifespan
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
v0.7
0v0.6
100- Range:
0 = use default value
- Change:
Dynamic
- Tags:
Min life of prefetch block
Notes: Removed in v0.8.0 by commit d4a72f238 (“Sequential scrub and resilvers”). Prefetch lifetime logic was reworked as part of the sequential scan changes. Replaced by zfs_arc_min_prefetch_ms and zfs_arc_min_prescient_prefetch_ms. arc_min_prefetch_lifespan is the minimum time for a prefetched block to remain in ARC before it is eligible for eviction.
zfs_arc_min_prefetch_ms
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Units:
ms
- Range:
0=use the built-in default of 1 second, otherwise 1 to INT_MAX
- Change:
Dynamic
- Tags:
Min life of prefetch block in ms
Notes: Minimum time prefetched blocks are locked in the ARC. A value of 0 represents the default of 1 second. However, once changed, dynamically setting to 0 will not return to the default.
zfs_arc_min_prescient_prefetch_ms
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Units:
ms
- Range:
0=use the built-in default of 6 seconds, otherwise 1 to INT_MAX
- Change:
Dynamic
- Tags:
Min life of prescient prefetched block in ms
Notes: Minimum time “prescient prefetched” blocks are locked in the ARC. These blocks are meant to be prefetched fairly aggressively ahead of the code that may use them. A value of 0 represents the default of 6 seconds. However, once changed, dynamically setting to 0 will not return to the default.
zfs_arc_no_grow_shift
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
5- Change:
Dynamic
- Tags:
log2(fraction of ARC which must be free to allow growing)
zfs_arc_num_sublists_per_state
- Versions:
v0.6
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1 or the number of on-online CPUs, whichever is greater- Change:
Dynamic
- Tags:
Number of sublists used in each of the ARC state lists
zfs_arc_p_aggressive_disable
- Versions:
v0.6
- Platforms:
Linux, FreeBSD
- Type:
int- Change:
Dynamic
- Tags:
disable aggressive arc_p grow
zfs_arc_p_dampener_disable
- Versions:
v0.6 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0avoid large adjustments
1permit large adjustments
- Change:
Dynamic
- Tags:
Disable arc_p adapt dampener
When to change: Testing ARC ghost list behaviour
Notes: Removed in v2.2.0 by commit a8d83e2a (“More adaptive ARC eviction”). Replaced by adaptive eviction with zfs_arc_meta_balance. When data is being added to the ghost lists, the MRU target size is adjusted. The amount of adjustment is based on the ratio of the MRU/MFU sizes. When enabled, the ratio is capped to 10, avoiding large adjustments.
zfs_arc_p_min_shift
- Versions:
v0.6 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
v0.7 - v2.1
0v0.6
4- Range:
0=use the built-in default of 4, otherwise 1 to INT_MAX
- Change:
Dynamic
- Tags:
arc_c shift to calc min/max arc_p
Verification: Observe changes to /proc/spl/kstat/zfs/arcstats entry p
Notes: Removed in v2.2.0 by commit a8d83e2a (“More adaptive ARC eviction”). Replaced by adaptive eviction with zfs_arc_meta_balance. arc_p_min_shift is used to shift of ARC target size (/proc/spl/kstat/zfs/arcstats entry c) for calculating both minimum and maximum most recently used (MRU) target size (/proc/spl/kstat/zfs/arcstats entry p) A value of 0 represents the default setting of arc_p_min_shift = 4. However, once changed, dynamically setting zfs_arc_p_min_shift to 0 will not return to the default.
zfs_arc_pc_percent
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Range:
0 to 100
- Change:
Dynamic
- Tags:
Percent of pagecache to reclaim ARC to
When to change: When using file systems under memory shortfall, if the page scanner causes the ARC to shrink too fast, then adjusting zfs_arc_pc_percent can reduce the shrink rate
Notes: zfs_arc_pc_percent allows ZFS arc to play more nicely with the kernel’s LRU pagecache. It can guarantee that the arc size won’t collapse under scanning pressure on the pagecache, yet still allows arc to be reclaimed down to zfs_arc_min if necessary. This value is specified as percent of pagecache size (as measured by NR_FILE_PAGES) where that percent may exceed 100. This only operates during memory pressure/reclaim.
zfs_arc_prune_task_threads
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Number of arc_prune threads
zfs_arc_shrink_shift
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v0.7 - master
0v0.6
5- Range:
0=use the built-in default of 7, otherwise 1 to INT_MAX
- Change:
Dynamic
- Tags:
log2(fraction of ARC to reclaim)
When to change: During memory shortfall, reducing zfs_arc_shrink_shift increases the rate of ARC shrinkage
Notes: arc_shrink_shift is used to adjust the ARC target sizes when large reduction is required. The current ARC target size, c, and MRU size p can be reduced by by the current size >> arc_shrink_shift. For the default value of 7, this reduces the target by approximately 0.8%. A value of 0 represents the default setting of arc_shrink_shift = 7. However, once changed, dynamically setting arc_shrink_shift to 0 will not return to the default.
zfs_arc_shrinker_limit
- Versions:
v2.0 - master
- Platforms:
Linux
- Type:
int- Default:
v2.3 - master
0v2.0 - v2.2
10,000- Change:
Dynamic
- Tags:
Limit on number of pages that ARC shrinker can reclaim at once
zfs_arc_shrinker_seeks
- Versions:
v2.2 - master
- Platforms:
Linux
- Type:
int- Default:
2- Change:
Prior to module load
- Tags:
Relative cost of ARC eviction vs other kernel subsystems
zfs_arc_sys_free
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
0- Range:
0 to ULONG_MAX
- Change:
Dynamic
- Tags:
System free memory target size in bytes
When to change: Change if more free memory is desired as a margin against memory demand by applications
Notes: zfs_arc_sys_free is the target number of bytes the ARC should leave as free memory on the system. Defaults to the larger of 1/64 of physical memory or 512K. Setting this option to a non-zero value will override the default. However, once changed, dynamically setting zfs_arc_sys_free to 0 will not return to the default.
zfs_async_block_max_blocks
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.2 - master
UINT64_MAXv2.0 - v2.1
ULONG_MAX (unlimited)v0.8
100,000- Range:
1 to MAX_ULONG
- Change:
Dynamic
- Tags:
Max number of blocks freed in one txg
Notes: zfs_async_block_max_blocks limits the number of blocks freed in a single transaction group commit. During deletes of large objects, such as snapshots, the number of freed blocks can cause the DMU to extend txg sync times well beyond zfs_txg_timeout. zfs_async_block_max_blocks is used to limit these effects.
zfs_async_free_zio_wait_interval
- Versions:
v2.4 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
2000- Change:
Dynamic
- Tags:
Wait for pending free I/Os after issuing this many asynchronously
zfs_autoimport_disable
- Versions:
v0.6 - v2.3
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0read
zpool.cacheat module load1do not read
zpool.cacheat module load- Change:
Dynamic
- Tags:
Disable pool import at module load
When to change: Leave as default so that zfs behaves as other Linux kernel modules
Notes: Disable reading zpool.cache file (see spa_config_path) when loading the zfs module.
zfs_bclone_enabled
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Enable block cloning
zfs_bclone_strict_properties
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Restrict cross-dataset cloning with different properties
zfs_bclone_wait_dirty
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
v2.3 - master
1v2.2
0- Change:
Dynamic
- Tags:
Wait for dirty blocks when cloning
zfs_btree_verify_intensity
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Change:
Dynamic
- Tags:
Enable btree verification. Levels above 4 require ZFS be built with debugging
zfs_ccw_retry_interval
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
300- Change:
Dynamic
- Tags:
Configuration cache file write, retry after failure, interval (seconds)
zfs_checksum_events_per_second
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
20- Range:
zedthreshold to MAX_UINT- Change:
Dynamic
- Tags:
Rate limit checksum events to this many checksum errors per second (do not set below ZED threshold).
Notes: zfs_checksum_events_per_second is a rate limit for checksum events. Note that this should not be set below the zed thresholds (currently 10 checksums over 10 sec) or else zed may not trigger any action.
zfs_checksums_per_second
- Versions:
v0.7
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
20- Change:
Dynamic
- Tags:
Rate limit checksum events to this many checksum errors per second (do not set below zedthreshold).
When to change: If processing checksum error events at a higher rate is desired
Notes: Renamed to zfs_checksum_events_per_second in v0.8.0 (commit ad796b8a3). The ZFS Event Daemon (zed) processes events from ZFS. However, it can be overwhelmed by high rates of error reports which can be generated by failing, high-performance devices. zfs_checksums_per_second limits the rate of checksum events reported to zed. Note: do not set this value lower than the SERD limit for checksum in zed. By default, checksum_N = 10 and checksum_T = 10 minutes, resulting in a practical lower limit of 1.
zfs_commit_timeout_pct
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.2 - master
10v0.8 - v2.1
5%- Range:
1 to 100
- Change:
Dynamic
- Tags:
ZIL block open timeout percentage
Notes: zfs_commit_timeout_pct controls the amount of time that a log (ZIL) write block (lwb) remains “open” when it isn’t “full” and it has a thread waiting to commit to stable storage. The timeout is scaled based on a percentage of the last lwb latency to avoid significantly impacting the latency of each individual intent log transaction (itx).
zfs_compressed_arc_enabled
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0compressed ARC disabled (legacy behaviour)
1compress ARC data
- Change:
Dynamic
- Tags:
Disable compressed ARC buffers
When to change: Testing ARC compression feature
Verification: raw ARC statistics are observable in /proc/spl/kstat/zfs/arcstats and ARC hit ratios can be observed using zarcstat (arcstat before 2.4.0)
Notes: When compression is enabled for a dataset, later reads of the data can store the blocks in ARC in their on-disk, compressed state. This can increase the effective size of the ARC, as counted in blocks, and thus improve the ARC hit ratio.
zfs_condense_indirect_commit_entry_delay_ms
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Used by tests to ensure certain actions happen in the middle of a condense. A maximum value of 1 should be sufficient.
When to change: do not change
Notes: During vdev removal, the vdev indirection layer sleeps for zfs_condense_indirect_commit_entry_delay_ms milliseconds during mapping generation. This parameter is used during automated testing of the ZFS code to improve test coverage.
zfs_condense_indirect_obsolete_pct
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
25- Change:
Dynamic
- Tags:
Minimum obsolete percent of bytes in the mapping to attempt condensing
zfs_condense_indirect_vdevs_enable
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not save memory
1save memory by condensing obsolete mapping after vdev removal
- Change:
Dynamic
- Tags:
Whether to attempt condensing indirect vdev mappings
Notes: During vdev removal, condensing process is an attempt to save memory by removing obsolete mappings. zfs_condense_indirect_vdevs_enable enables condensing indirect vdev mappings. When set, ZFS attempts to condense indirect vdev mappings if the mapping uses more than zfs_condense_min_mapping_bytes bytes of memory and if the obsolete space map object uses more than zfs_condense_max_obsolete_bytes bytes on disk.
zfs_condense_max_obsolete_bytes
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1073741824- Range:
0 to MAX_ULONG
- Change:
Dynamic
- Tags:
Minimum size obsolete spacemap to attempt condensing
When to change: no not change
Notes: After vdev removal, zfs_condense_max_obsolete_bytes sets the limit for beginning the condensing process. Condensing begins if the obsolete space map takes up more than zfs_condense_max_obsolete_bytes of space on disk (logically). The default of 1 GiB is small enough relative to a typical pool that the space consumed by the obsolete space map is minimal. See also zfs_condense_indirect_vdevs_enable
zfs_condense_min_mapping_bytes
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
131072- Range:
0 to MAX_ULONG
- Change:
Dynamic
- Tags:
Don’t bother condensing if the mapping uses less than this amount of memory
When to change: do not change
Notes: After vdev removal, zfs_condense_min_mapping_bytes is the lower limit for determining when to condense the in-memory obsolete space map. The condensing process will not continue unless a minimum of zfs_condense_min_mapping_bytes of memory can be freed. See also zfs_condense_indirect_vdevs_enable
zfs_dbgmsg_enable
- Versions:
v0.6 - master
- Platforms:
FreeBSD
- Type:
int- Default:
v2.1 - master
1v0.6 - v2.0
0- Range:
0do not log debug messages
1log debug messages
- Change:
Dynamic
- Tags:
Enable ZFS debug message log
When to change: To view ZFS internal debug log
Notes: Internally ZFS keeps a small log to facilitate debugging. The contents of the log are in the /proc/spl/kstat/zfs/dbgmsg file. Writing 0 to /proc/spl/kstat/zfs/dbgmsg file clears the log. See also zfs_dbgmsg_maxsize
zfs_dbgmsg_maxsize
- Versions:
v0.6 - master
- Platforms:
FreeBSD
- Type:
uint- Default:
v2.1 - master
4194304v0.6 - v2.0
4M- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
Maximum ZFS debug log size
Notes: The /proc/spl/kstat/zfs/dbgmsg file size limit is set by zfs_dbgmsg_maxsize. See also zfs_dbgmsg_enable
zfs_dbuf_state_index
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Calculate arc header index
When to change: Do not change
Notes: The zfs_dbuf_state_index feature is currently unused. It is normally used for controlling values in the /proc/spl/kstat/zfs/dbufs file.
zfs_ddt_data_is_special
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not use special vdevs to store DDT
1store DDT in special vdevs
- Change:
Dynamic
- Tags:
Place DDT data into the special class
When to change: when using a special top-level vdev and no dedup top-level vdev and it is desired to store the DDT in the main pool top-level vdevs
Notes: zfs_ddt_data_is_special enables the deduplication table (DDT) to reside on a special top-level vdev.
zfs_deadman_checktime_ms
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v0.8 - master
60,000v0.7
5,000- Range:
1 to ULONG_MAX
- Change:
Dynamic
- Tags:
Dead I/O check interval in milliseconds
When to change: When debugging slow I/O
Notes: Once a pool sync operation has taken longer than zfs_deadman_synctime_ms milliseconds, continue to check for slow operations every zfs_deadman_checktime_ms milliseconds.
zfs_deadman_enabled
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not log slow I/O
1log slow I/O
- Change:
Dynamic
- Tags:
Enable deadman timer
When to change: To disable logging of slow I/O
Notes: When a pool sync operation takes longer than zfs_deadman_synctime_ms milliseconds, a “slow spa_sync” message is logged to the debug log (see zfs_dbgmsg_enable). If zfs_deadman_enabled is set to 1, then all pending IO operations are also checked and if any haven’t completed within zfs_deadman_synctime_ms milliseconds, a “SLOW IO” message is logged to the debug log and a “deadman” system event (see zpool events command) with the details of the hung IO is posted.
zfs_deadman_events_per_second
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Change:
Dynamic
- Tags:
Rate limit hung IO (deadman) events to this many per second
zfs_deadman_failmode
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
charp- Default:
wait- Range:
waitwait for the “hung” I/O (default)
continueattempt to recover from the “hung” I/O
panicpanic the system
- Change:
Dynamic
- Tags:
Failmode for deadman timer
When to change: In some cluster cases, panic can be appropriate
Notes: zfs_deadman_failmode controls the behavior of the I/O deadman timer when it detects a “hung” I/O..
zfs_deadman_synctime_ms
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v0.8 - master
600,000v0.6 - v0.7
1,000,000- Range:
1 to ULONG_MAX
- Change:
Dynamic
- Tags:
Pool sync expiration time in milliseconds
When to change: When debugging slow I/O
Notes: The I/O deadman timer expiration time has two meanings 1. determines when the spa_deadman() logic should fire, indicating the txg sync has not completed in a timely manner 2. determines if an I/O is considered “hung” In version v0.8.0, any I/O that has not completed in zfs_deadman_synctime_ms is considered “hung” resulting in one of three behaviors controlled by the zfs_deadman_failmode parameter. zfs_deadman_synctime_ms takes effect if zfs_deadman_enabled = 1.
zfs_deadman_ziotime_ms
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
300000- Range:
1 to ULONG_MAX
- Change:
Dynamic
- Tags:
IO expiration time in milliseconds
When to change: Testing ABD features
Notes: When an individual I/O takes longer than zfs_deadman_ziotime_ms milliseconds, then the operation is considered to be “hung”. If zfs_deadman_enabled is set then the deadman behaviour is invoked as described by the zfs_deadman_failmode option.
zfs_dedup_log_cap
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
UINT_MAX- Change:
Dynamic
- Tags:
Soft cap for the size of the current dedup log
zfs_dedup_log_flush_entries_max
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
UINT_MAX- Change:
Dynamic
- Tags:
Max number of log entries to flush each transaction
zfs_dedup_log_flush_entries_min
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
100- Change:
Dynamic
- Tags:
Min number of log entries to flush each transaction
zfs_dedup_log_flush_flow_rate_txgs
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Change:
Dynamic
- Tags:
Number of txgs to average flow rates across
zfs_dedup_log_flush_min_time_ms
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1000- Change:
Dynamic
- Tags:
Min time to spend on incremental dedup log flush each transaction
zfs_dedup_log_flush_txgs
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
100- Change:
Dynamic
- Tags:
Number of TXGs to try to rotate the log in
zfs_dedup_log_hard_cap
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Change:
Dynamic
- Tags:
Whether to use the soft cap as a hard cap
zfs_dedup_log_mem_max
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
0- Change:
Prior to module load
- Tags:
Max memory for dedup logs
zfs_dedup_log_mem_max_percent
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Change:
Prior to module load
- Tags:
Max memory for dedup logs, as % of total memory
zfs_dedup_log_txg_max
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
8- Change:
Dynamic
- Tags:
Max transactions before starting to flush dedup logs
zfs_dedup_prefetch
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0do not prefetch
1prefetch dedup table entries
- Change:
Dynamic
- Tags:
Enable prefetching dedup-ed blks
When to change: For systems with limited RAM using the dedup feature, disabling deduplication table prefetch can reduce memory pressure
Notes: ZFS can prefetch deduplication table (DDT) entries. zfs_dedup_prefetch allows DDT prefetches to be enabled.
zfs_default_bs
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
9- Change:
Dynamic
- Tags:
Default dnode block shift
zfs_default_ibs
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
17- Change:
Dynamic
- Tags:
Default dnode indirect block shift
zfs_delay_min_dirty_percent
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
60- Range:
0 to 100
- Change:
Dynamic
- Tags:
Transaction delay threshold
When to change: See ZFS Transaction Delay
Notes: The ZFS write throttle begins to delay each transaction when the amount of dirty data reaches the threshold zfs_delay_min_dirty_percent of zfs_dirty_data_max. This value should be >= zfs_vdev_async_write_active_max_dirty_percent.
zfs_delay_scale
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
500000- Range:
0 to ULONG_MAX
- Change:
Dynamic
- Tags:
How quickly delay approaches infinity
When to change: See ZFS Transaction Delay
Notes: zfs_delay_scale controls how quickly the ZFS write throttle transaction delay approaches infinity. Larger values cause longer delays for a given amount of dirty data. For the smoothest delay, this value should be about 1 billion divided by the maximum number of write operations per second the pool can sustain. The throttle will smoothly handle between 10x and 1/10th zfs_delay_scale. Note: zfs_delay_scale * zfs_dirty_data_max must be < 2^64.
zfs_delays_per_second
- Versions:
v0.7
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
20- Change:
Dynamic
- Tags:
Rate limit delay events to this many IO delays per second
When to change: If processing delay events at a higher rate is desired
Notes: Renamed to zfs_slow_io_events_per_second in v0.8.0 (commit ad796b8a3). The ZFS Event Daemon (zed) processes events from ZFS. However, it can be overwhelmed by high rates of error reports which can be generated by failing, high-performance devices. zfs_delays_per_second limits the rate of delay events reported to zed.
zfs_delete_blocks
- Versions:
v0.7 - master
- Platforms:
Linux
- Type:
ulong- Default:
20480- Range:
1 to ULONG_MAX
- Change:
Dynamic
- Tags:
Delete files larger than N blocks async
When to change: If applications delete large files and blocking on unlink(2) is not desired
Notes: zfs_delete_blocks defines a large file for the purposes of delete. Files containing more than zfs_delete_blocks will be deleted asynchronously while smaller files are deleted synchronously. Decreasing this value reduces the time spent in an unlink(2) system call at the expense of a longer delay before the freed space is available. The zfs_delete_blocks value is specified in blocks, not bytes. The size of blocks can vary and is ultimately limited by the filesystem’s recordsize property.
zfs_delete_dentry
Delete dentries from dentry cache as soon as the last reference is released.
zfs_delete_inode
Delete inodes as soon as the last reference is released.
zfs_dio_enabled
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
v2.4 - master
1v2.3
0- Change:
Dynamic
- Tags:
Enable Direct I/O
zfs_dio_strict
- Versions:
v2.4 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Return errors on misaligned Direct I/O
zfs_dio_write_verify_events_per_second
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
20- Change:
Dynamic
- Tags:
Rate Direct I/O write verify events to this many per second
zfs_dirty_data_max
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Range:
1 to zfs_dirty_data_max_max
- Change:
Dynamic
- Tags:
Determines the dirty space limit
When to change: See ZFS Transaction Delay
Notes: zfs_dirty_data_max is the ZFS write throttle dirty space limit. Once this limit is exceeded, new writes are delayed until space is freed by writes being committed to the pool. zfs_dirty_data_max takes precedence over zfs_dirty_data_max_percent.
zfs_dirty_data_max_max
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Range:
1 to physical RAM size
- Change:
Prior to module load
- Tags:
zfs_dirty_data_max upper bound in bytes
When to change: See ZFS Transaction Delay
Notes: zfs_dirty_data_max_max is the maximum allowable value of zfs_dirty_data_max. zfs_dirty_data_max_max takes precedence over zfs_dirty_data_max_max_percent.
zfs_dirty_data_max_max_percent
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
25- Range:
1 to 100
- Change:
Prior to module load
- Tags:
zfs_dirty_data_max upper bound as % of RAM
When to change: See ZFS Transaction Delay
Notes: zfs_dirty_data_max_max_percent an alternative to zfs_dirty_data_max_max for setting the maximum allowable value of zfs_dirty_data_max zfs_dirty_data_max_max takes precedence over zfs_dirty_data_max_max_percent
zfs_dirty_data_max_percent
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Range:
1 to 100
- Change:
Prior to module load
- Tags:
Max percent of RAM allowed to be dirty
When to change: See ZFS Transaction Delay
Notes: zfs_dirty_data_max_percent is an alternative method of specifying zfs_dirty_data_max, the ZFS write throttle dirty space limit. Once this limit is exceeded, new writes are delayed until space is freed by writes being committed to the pool. zfs_dirty_data_max takes precedence over zfs_dirty_data_max_percent.
zfs_dirty_data_sync
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
67,108,864- Range:
1 to ULONG_MAX
- Change:
Dynamic
- Tags:
sync txg when this much dirty data
Notes: When there is at least zfs_dirty_data_sync dirty data, a transaction group sync is started. This allows a transaction group sync to occur more frequently than the transaction group timeout interval (see zfs_txg_timeout) when there is dirty data to be written.
zfs_dirty_data_sync_percent
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
20- Range:
1 to zfs_vdev_async_write_active_min_dirty_percent
- Change:
Dynamic
- Tags:
Dirty data txg sync threshold as a percentage of zfs_dirty_data_max
Notes: When there is at least zfs_dirty_data_sync_percent of zfs_dirty_data_max dirty data, a transaction group sync is started. This allows a transaction group sync to occur more frequently than the transaction group timeout interval (see zfs_txg_timeout) when there is dirty data to be written.
zfs_disable_dup_eviction
- Versions:
v0.6
- Platforms:
Linux, FreeBSD
- Type:
int- Range:
0duplicate buffers can be evicted
1do not evict duplicate buffers
- Change:
Dynamic
- Tags:
disable duplicate buffer eviction
Notes: Removed in v0.7.0 by commit d3c2ae1c0 (“OpenZFS 6950 - ARC should cache compressed data”). Duplicate buffer handling was reworked as part of the compressed ARC changes. No replacement parameter. Disable duplicate buffer eviction from ARC.
zfs_disable_ivset_guid_check
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0check IVset guid
1do not check IVset guid
- Change:
Dynamic
- Tags:
Set to allow raw receives without IVset guids
When to change: debugging pre-release ZFS raw sends
Notes: zfs_disable_ivset_guid_check disables requirement for IVset guids to be present and match when doing a raw receive of encrypted datasets. Intended for users whose pools were created with ZFS on Linux pre-release versions and now have compatibility issues. For a ZFS raw receive, from a send stream created by zfs send --raw, the crypt_keydata nvlist includes a to_ivset_guid to be set on the new snapshot. This value will override the value generated by the snapshot code. However, this value may not be present, because older implementations of the raw send code did not include this value. When zfs_disable_ivset_guid_check is enabled, the receive proceeds and a newly-generated value is used.
zfs_dmu_offset_next_sync
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not force txg sync to find holes
1force txg sync to find holes
- Change:
Dynamic
- Tags:
Enable forcing txg sync to find holes
When to change: to exchange strict hole reporting for performance
Notes: zfs_dmu_offset_next_sync enables forcing txg sync to find holes. This causes ZFS to act like older versions when SEEK_HOLE or SEEK_DATA flags are used: when a dirty dnode causes txgs to be synced so the previous data can be found.
zfs_embedded_slog_min_ms
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
64- Change:
Dynamic
- Tags:
Minimum number of metaslabs required to dedicate one for log blocks
zfs_expire_snapshot
- Versions:
v0.6 - master
- Platforms:
Linux
- Type:
int- Default:
300- Range:
0 disables automatic unmounting, maximum time is INT_MAX
- Change:
Dynamic
- Tags:
Seconds to expire .zfs/snapshot
Notes: Snapshots of filesystems are normally automounted under the filesystem’s .zfs/snapshot subdirectory. When not in use, snapshots are unmounted after zfs_expire_snapshot seconds.
zfs_fallocate_reserve_percent
- Versions:
v2.0 - master
- Platforms:
Linux
- Type:
uint- Default:
110- Change:
Dynamic
- Tags:
Percentage of length to use for the available capacity check
zfs_flags
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Change:
Dynamic
- Tags:
Set additional debugging flags
When to change: When debugging ZFS
zfs_fletcher_4_impl
- Versions:
v0.7 - v0.8
- Platforms:
Linux, FreeBSD
- Type:
string- Default:
fastest- Range:
fastest, scalar, superscalar, superscalar4, sse2, ssse3, avx2, avx512f, or aarch64_neon depending on hardware support
- Change:
Dynamic
- Tags:
Select fletcher 4 implementation.
When to change: Testing Fletcher-4 algorithms
Notes: Fletcher-4 is the default checksum algorithm for metadata and data. When the zfs kernel module is loaded, a set of microbenchmarks are run to determine the fastest algorithm for the current hardware. The zfs_fletcher_4_impl parameter allows a specific implementation to be specified other than the default (fastest). Selectors other than fastest and scalar require instruction set extensions to be available and will only appear if ZFS detects their presence. The scalar implementation works on all processors. The results of the microbenchmark are visible in the /proc/spl/kstat/zfs/fletcher_4_bench file. Larger numbers indicate better performance. Since ZFS is processor endian-independent, the microbenchmark is run against both big and little-endian transformation.
zfs_free_bpobj_enabled
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not process free_bpobj objects
1process free_bpobj objects
- Change:
Dynamic
- Tags:
Enable processing of the free_bpobj
When to change: If there’s a problem with processing free_bpobj (e.g. i/o error or bug)
zfs_free_leak_on_eio
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0normal behavior
1ignore error and permanently leak space
- Change:
Dynamic
- Tags:
Set to ignore IO errors during free and permanently leak the space
When to change: When debugging I/O errors during destroy
Notes: If destroy encounters an I/O error (EIO) while reading metadata (eg indirect blocks), space referenced by the missing metadata cannot be freed. Normally, this causes the background destroy to become “stalled”, as the destroy is unable to make forward progress. While in this stalled state, all remaining space to free from the error-encountering filesystem is temporarily leaked. Set zfs_free_leak_on_eio = 1 to ignore the EIO, permanently leak the space from indirect blocks that can not be read, and continue to free everything else that it can. The default, stalling behavior is useful if the storage partially fails (eg some but not all I/Os fail), and then later recovers. In this case, we will be able to continue pool operations while it is partially failed, and when it recovers, we can continue to free the space, with no leaks. However, note that this case is rare. Typically pools either: 1. fail completely (but perhaps temporarily (eg a top-level vdev going offline) 2. have localized, permanent errors (eg disk returns the wrong data due to bit flip or firmware bug) In case (1), the zfs_free_leak_on_eio setting does not matter because the pool will be suspended and the sync thread will not be able to make forward progress. In case (2), because the error is permanent, the best effort do is leak the minimum amount of space. Therefore, it is reasonable for zfs_free_leak_on_eio be set, but by default the more conservative approach is taken, so that there is no possibility of leaking space in the “partial temporary” failure case.
zfs_free_max_blocks
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
100,000- Range:
1 to ULONG_MAX
- Change:
Dynamic
- Tags:
Max number of blocks freed in one txg
When to change: For workloads that delete large files, zfs_free_max_blocks can be adjusted to meet performance requirements while reducing the impacts of deletion
Notes: zfs_free_max_blocks sets the maximum number of blocks to be freed in a single transaction group (txg). For workloads that delete (free) large numbers of blocks in a short period of time, the processing of the frees can negatively impact other operations, including txg commits. zfs_free_max_blocks acts as a limit to reduce the impact.
zfs_free_min_time_ms
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.4 - master
500v0.6 - v2.3
1,000- Range:
1 to (zfs_txg_timeout * 1000)
- Change:
Dynamic
- Tags:
Min millisecs to free per txg
Notes: During a zfs destroy operation using feature@async_destroy a minimum of zfs_free_min_time_ms time will be spent working on freeing blocks per txg commit.
zfs_history_output_max
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1048576- Change:
Dynamic
- Tags:
Maximum size in bytes of ZFS ioctl output that will be logged
zfs_immediate_write_sz
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
32768- Range:
512 to 16,777,216 (valid block sizes)
- Change:
Dynamic
- Tags:
Largest write size to store data into ZIL
Verification: Data blocks that exceed zfs_immediate_write_sz or are written as logbias=throughput increment the zil_itx_indirect_count entry in /proc/spl/kstat/zfs/zil
Notes: If a pool does not have a log device, data blocks equal to or larger than zfs_immediate_write_sz are treated as if the dataset being written to had the property setting logbias=throughput Terminology note: logbias=throughput writes the blocks in “indirect mode” to the ZIL where the data is written to the pool and a pointer to the data is written to the ZIL.
zfs_import_defer_txgs
- Versions:
v2.4 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
5- Change:
Dynamic
- Tags:
Number of TXGs to defer background work after pool import
zfs_initialize_chunk_size
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1048576- Change:
Dynamic
- Tags:
Size in bytes of writes by zpool initialize
zfs_initialize_value
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
16045690984833335022- Change:
Dynamic
- Tags:
Value written during zpool initialize
When to change: when debugging initialization code
Notes: When initializing a vdev, ZFS writes patterns of zfs_initialize_value bytes to the device.
zfs_keep_log_spacemaps_at_export
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Prevent the log spacemaps from being flushed and destroyed during pool export/destroy
zfs_key_max_salt_uses
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
ulong- Default:
400000000- Range:
1 to ULONG_MAX
- Change:
Dynamic
- Tags:
Max number of times a salt value can be used for generating encryption keys before it is rotated
When to change: Testing encryption features
Notes: For encrypted datasets, the salt is regenerated every zfs_key_max_salt_uses blocks. This automatic regeneration reduces the probability of collisions due to the Birthday problem. When set to the default (400,000,000) the probability of collision is approximately 1 in 1 trillion.
zfs_livelist_condense_new_alloc
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Whether extra ALLOC blkptrs were added to a livelist entry while it was being condensed
zfs_livelist_condense_sync_cancel
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Whether livelist condensing was canceled in the synctask
zfs_livelist_condense_sync_pause
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Set the livelist condense synctask to pause
zfs_livelist_condense_zthr_cancel
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Whether livelist condensing was canceled in the zthr function
zfs_livelist_condense_zthr_pause
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Set the livelist condense zthr to pause
zfs_livelist_max_entries
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
500000- Change:
Dynamic
- Tags:
Size to start the next sub-livelist in a livelist
zfs_lua_max_instrlimit
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
100000000- Range:
0 to MAX_ULONG
- Change:
Dynamic
- Tags:
Max instruction limit that can be specified for a channel program
When to change: to enforce a CPU usage limit on ZFS channel programs
zfs_lua_max_memlimit
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
104857600- Range:
0 to MAX_ULONG
- Change:
Dynamic
- Tags:
Max memory limit that can be specified for a channel program
zfs_max_async_dedup_frees
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.4 - master
250000v2.0 - v2.3
100,000- Change:
Dynamic
- Tags:
Max number of dedup, clone or gang blocks freed in one txg
zfs_max_dataset_nesting
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
50- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Limit to the amount of nesting a path can have. Defaults to 50.
When to change: can be tuned temporarily to fix existing datasets that exceed the predefined limit
Notes: zfs_max_dataset_nesting limits the depth of nested datasets. Deeply nested datasets can overflow the stack. The maximum stack depth depends on kernel compilation options, so it is impractical to predict the possible limits. For kernels compiled with small stack sizes, zfs_max_dataset_nesting may require changes.
zfs_max_log_walking
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
5- Change:
Dynamic
- Tags:
The number of past TXGs that the flushing algorithm of the log spacemap feature uses to estimate incoming log blocks
zfs_max_logsm_summary_length
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
10- Change:
Dynamic
- Tags:
Maximum number of rows allowed in the summary of the spacemap log
zfs_max_missing_tvds
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
0- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Allow importing pool with up to this number of missing top-level vdevs (in read-only mode)
When to change: troubleshooting pools with missing devices
Notes: When importing a pool in readonly mode (zpool import -o readonly=on ...) then up to zfs_max_missing_tvds top-level vdevs can be missing, but the import can attempt to progress. Note: This is strictly intended for advanced pool recovery cases since missing data is almost inevitable. Pools with missing devices can only be imported read-only for safety reasons, and the pool’s failmode property is automatically set to continue The expected use case is to recover pool data immediately after accidentally adding a non-protected vdev to a protected pool. - With 1 missing top-level vdev, ZFS should be able to import the pool and mount all datasets. User data that was not modified after the missing device has been added should be recoverable. Thus snapshots created prior to the addition of that device should be completely intact. - With 2 missing top-level vdevs, some datasets may fail to mount since there are dataset statistics that are stored as regular metadata. Some data might be recoverable if those vdevs were added recently. - With 3 or more top-level missing vdevs, the pool is severely damaged and MOS entries may be missing entirely. Chances of data recovery are very low. Note that there are also risks of performing an inadvertent rewind as we might be missing all the vdevs with the latest uberblocks.
zfs_max_missing_tvds_cachefile
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
2- Change:
Dynamic
- Tags:
Allow importing pools with missing top-level vdevs in cache file
zfs_max_missing_tvds_scan
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
0- Change:
Dynamic
- Tags:
Allow importing pools with missing top-level vdevs during scan
zfs_max_nvlist_src_size
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Change:
Dynamic
- Tags:
Maximum size in bytes allowed for src nvlist passed with ZFS ioctls
zfs_max_recordsize
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.2 - master
16777216v0.6 - v2.1
1,048,576- Range:
512 to 16,777,216 (valid block sizes)
- Change:
Dynamic
- Tags:
Max allowed record size
When to change: To create datasets with larger volblocksize or recordsize
Notes: ZFS supports logical record (block) sizes from 512 bytes to 16 MiB. The benefits of larger blocks, and thus larger average I/O sizes, can be weighed against the cost of copy-on-write of large block to modify one byte. Additionally, very large blocks can have a negative impact on both I/O latency at the device level and the memory allocator. The zfs_max_recordsize parameter limits the upper bound of the dataset volblocksize and recordsize properties. Larger blocks can be created by enabling zpool large_blocks feature and changing this zfs_max_recordsize. Pools with larger blocks can always be imported and used, regardless of the value of zfs_max_recordsize. For 32-bit systems, zfs_max_recordsize also limits the size of kernel virtual memory caches used in the ZFS I/O pipeline (zio_buf_* and zio_data_buf_*). See also the zpool large_blocks feature.
zfs_mdcomp_disable
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Range:
0compress metadata
1do not compress metadata
- Change:
Dynamic
- Tags:
Disable meta data compression
When to change: When CPU cycles cost less than I/O
zfs_metaslab_condense_pct
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
200- Change:
Dynamic
- Tags:
Condense on-disk spacemap when it is more than this many percents of in-memory counterpart
zfs_metaslab_find_max_tries
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
100- Change:
Dynamic
- Tags:
Normally only consider this many of the best metaslabs in each vdev
zfs_metaslab_fragmentation_threshold
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.3 - master
77v0.6 - v2.2
70- Range:
1 to 100
- Change:
Dynamic
- Tags:
Fragmentation for metaslab to allow allocation
When to change: Testing metaslab allocation
Notes: Allow metaslabs to keep their active state as long as their fragmentation percentage is less than or equal to this value. When writing, an active metaslab whose fragmentation percentage exceeds zfs_metaslab_fragmentation_threshold is avoided allowing metaslabs with less fragmentation to be preferred. Metaslab fragmentation is used to calculate the overall pool fragmentation property value. However, individual metaslab fragmentation levels are observable using the zdb with the -mm option. zfs_metaslab_fragmentation_threshold works at the metaslab level and each top-level vdev has approximately zfs_vdev_default_ms_count metaslabs. See also zfs_mg_fragmentation_threshold
zfs_metaslab_max_size_cache_sec
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
3600- Change:
Dynamic
- Tags:
How long to trust the cached max chunk size of a metaslab
zfs_metaslab_mem_limit
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
25- Change:
Dynamic
- Tags:
Percentage of memory that can be used to store metaslab range trees
zfs_metaslab_segment_weight_enabled
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not consider metaslab fragmentation
1avoid metaslabs where free space is highly fragmented
- Change:
Dynamic
- Tags:
Enable segment-based metaslab selection
When to change: When testing allocation and fragmentation
Notes: Enables metaslab allocation based on largest free segment rather than total amount of free space. The goal is to avoid metaslabs that exhibit free space fragmentation: when there is a lot of small free spaces, but few larger free spaces. If zfs_metaslab_segment_weight_enabled is enabled, then metaslab_fragmentation_factor_enabled is ignored.
zfs_metaslab_sm_blksz_no_log
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
16384- Change:
Dynamic
- Tags:
Block size for space map in pools with log space map disabled. Power of 2 greater than 4096.
zfs_metaslab_sm_blksz_with_log
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
131072- Change:
Dynamic
- Tags:
Block size for space map in pools with log space map enabled. Power of 2 greater than 4096.
zfs_metaslab_switch_threshold
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
2- Range:
0 to UINT64_MAX
- Change:
Dynamic
- Tags:
Segment-based metaslab selection maximum buckets before switching
When to change: When testing allocation and fragmentation
Notes: When using segment-based metaslab selection (see zfs_metaslab_segment_weight_enabled), continue allocating from the active metaslab until zfs_metaslab_switch_threshold worth of free space buckets have been exhausted.
zfs_metaslab_try_hard_before_gang
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Try hard to allocate before ganging
zfs_mg_fragmentation_threshold
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v0.8 - master
95v0.6 - v0.7
85- Range:
1 to 100
- Change:
Dynamic
- Tags:
Percentage of metaslab group size that should be considered eligible for allocations unless all metaslab groups within the metaslab class have also crossed this threshold
When to change: Testing metaslab allocation
Notes: Metaslab groups (top-level vdevs) are considered eligible for allocations if their fragmentation percentage metric is less than or equal to zfs_mg_fragmentation_threshold. If a metaslab group exceeds this threshold then it will be skipped unless all metaslab groups within the metaslab class have also crossed the zfs_mg_fragmentation_threshold threshold.
zfs_mg_noalloc_threshold
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Range:
0 to 100
- Change:
Dynamic
- Tags:
Percentage of metaslab group size that should be free to make it eligible for allocation
When to change: To force rebalancing as top-level vdevs are added or expanded
Notes: Metaslab groups (top-level vdevs) with free space percentage greater than zfs_mg_noalloc_threshold are eligible for new allocations. If a metaslab group’s free space is less than or equal to the threshold, the allocator avoids allocating to that group unless all groups in the pool have reached the threshold. Once all metaslab groups have reached the threshold, all metaslab groups are allowed to accept allocations. The default value of 0 disables the feature and causes all metaslab groups to be eligible for allocations. This parameter allows one to deal with pools having heavily imbalanced vdevs such as would be the case when a new vdev has been added. Setting the threshold to a non-zero percentage will stop allocations from being made to vdevs that aren’t filled to the specified percentage and allow lesser filled vdevs to acquire more allocations than they otherwise would under the older zfs_mg_alloc_failures facility.
zfs_min_metaslabs_to_condense_pct
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
5- Change:
Dynamic
- Tags:
Minimum number of metaslabs to flush per TXG when condensing, as a percent of the number of dirty metaslabs at condense start.
zfs_min_metaslabs_to_flush
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1- Change:
Dynamic
- Tags:
Minimum number of metaslabs to flush per dirty TXG
zfs_multihost_fail_intervals
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v0.8 - master
10v0.7
5- Change:
Dynamic
- Tags:
Max allowed period without a successful mmp write
Notes: zfs_multihost_fail_intervals controls the behavior of the pool when write failures are detected in the multihost multimodifier protection (MMP) subsystem. If zfs_multihost_fail_intervals = 0 then multihost write failures are ignored. The write failures are reported to the ZFS event daemon (zed) which can take action such as suspending the pool or offlining a device. If zfs_multihost_fail_intervals > 0 then sequential multihost write failures will cause the pool to be suspended. This occurs when (zfs_multihost_fail_intervals * zfs_multihost_interval) milliseconds have passed since the last successful multihost write. This guarantees the activity test will see multihost writes if the pool is attempted to be imported by another system.
zfs_multihost_history
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
Historical statistics for last N multihost writes
When to change: When testing multihost feature
Notes: The pool multihost multimodifier protection (MMP) subsystem can record historical updates in the /proc/spl/kstat/zfs/POOL_NAME/multihost file for debugging purposes. The number of lines of history is determined by zfs_multihost_history.
zfs_multihost_import_intervals
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v0.8 - master
20v0.7
10- Range:
1 to UINT_MAX
- Change:
Dynamic
- Tags:
Number of zfs_multihost_interval periods to wait for activity
Notes: zfs_multihost_import_intervals controls the duration of the activity test on pool import for the multihost multimodifier protection (MMP) subsystem. The activity test can be expected to take a minimum time of (zfs_multihost_import_intervals * zfs_multihost_interval * random(25%)) milliseconds. The random period of up to 25% improves simultaneous import detection. For example, if two hosts are rebooted at the same time and automatically attempt to import the pool, then is is highly probable that one host will win. Smaller values of zfs_multihost_import_intervals reduces the import time but increases the risk of failing to detect an active pool. The total activity check time is never allowed to drop below one second. Note: the multihost protection feature applies to storage devices that can be shared between multiple systems.
zfs_multihost_interval
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1000- Range:
100 to ULONG_MAX
- Change:
Dynamic
- Tags:
Milliseconds between mmp writes to each leaf
When to change: To optimize pool import time against possibility of simultaneous import by another system
Notes: zfs_multihost_interval controls the frequency of multihost writes performed by the pool multihost multimodifier protection (MMP) subsystem. The multihost write period is (zfs_multihost_interval / number of leaf-vdevs) milliseconds. Thus on average a multihost write will be issued for each leaf vdev every zfs_multihost_interval milliseconds. In practice, the observed period can vary with the I/O load and this observed value is the delay which is stored in the uberblock. On import the multihost activity check waits a minimum amount of time determined by (zfs_multihost_interval * zfs_multihost_import_intervals) with a lower bound of 1 second. The activity check time may be further extended if the value of mmp delay found in the best uberblock indicates actual multihost updates happened at longer intervals than zfs_multihost_interval Note: the multihost protection feature applies to storage devices that can be shared between multiple systems.
zfs_multilist_num_sublists
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.1 - master
0v0.7 - v2.0
4 or the number of online CPUs, whichever is greater- Range:
1 to INT_MAX
- Change:
Dynamic
- Tags:
Number of sublists used in each multilist
Notes: To allow more fine-grained locking, each ARC state contains a series of lists (sublists) for both data and metadata objects. Locking is performed at the sublist level. This parameters controls the number of sublists per ARC state, and also applies to other uses of the multilist data structure.
zfs_no_scrub_io
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0perform scrub I/O
1do not perform scrub I/O
- Change:
Dynamic
- Tags:
Set to disable scrub I/O
When to change: Testing scrub feature
Notes: When zfs_no_scrub_io = 1 scrubs do not actually scrub data and simply doing a metadata crawl of the pool instead.
zfs_no_scrub_prefetch
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0prefetch scrub I/Os
1do not prefetch scrub I/Os
- Change:
Dynamic
- Tags:
Set to disable scrub prefetching
When to change: Testing scrub feature
Notes: When zfs_no_scrub_prefetch = 1, prefetch is disabled for scrub I/Os.
zfs_nocacheflush
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0send cache flush commands
1do not send cache flush commands
- Change:
Dynamic
- Tags:
Disable cache flushes
When to change: If the storage device has nonvolatile cache, then disabling cache flush can save the cost of occasional cache flush commands
Notes: ZFS uses barriers (volatile cache flush commands) to ensure data is committed to permanent media by devices. This ensures consistent on-media state for devices where caches are volatile (eg HDDs). For devices with nonvolatile caches, the cache flush operation can be a no-op. However, in some RAID arrays, cache flushes can cause the entire cache to be flushed to the backing devices. To ensure on-media consistency, keep cache flush enabled.
zfs_nopwrite_enabled
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0disable NOP-write feature
1enable NOP-write feature
- Change:
Dynamic
- Tags:
Enable NOP writes
Notes: The NOP-write feature is enabled by default when a cryptographically-secure checksum algorithm is in use by the dataset. zfs_nopwrite_enabled allows the NOP-write feature to be completely disabled.
zfs_object_mutex_size
- Versions:
v0.7 - master
- Platforms:
Linux
- Type:
uint- Default:
64- Range:
1 to UINT_MAX
- Change:
Dynamic
- Tags:
Size of znode hold array
When to change: Testing znode mutex array deadlocks
Notes: zfs_object_mutex_size facilitates resizing the the per-dataset znode mutex array for testing deadlocks therein.
zfs_obsolete_min_time_ms
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
500- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Min millisecs to obsolete per txg
Notes: zfs_obsolete_min_time_ms is similar to zfs_free_min_time_ms and used for cleanup of old indirection records for vdevs removed using the zpool remove command.
zfs_override_estimate_recordsize
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Range:
0=do not override, 1 to MAX_ULONG
- Change:
Dynamic
- Tags:
Override block size estimate with fixed size
When to change: if most data in your dataset is not of the current recordsize and you require accurate zfs send size estimates
Notes: zfs_override_estimate_recordsize overrides the default logic for estimating block sizes when doing a zfs send. The default heuristic is that the average block size will be the current recordsize.
zfs_pd_bytes_max
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
52428800- Range:
0 to INT32_MAX
- Change:
Dynamic
- Tags:
Max number of bytes to prefetch
Notes: zfs_pd_bytes_max limits the number of bytes prefetched during a pool traversal (eg zfs send or other data crawling operations). These prefetches are referred to as “prescient prefetches” and are always 100% hit rate. The traversal operations do not use the default data or metadata prefetcher.
zfs_per_txg_dirty_frees_percent
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
30- Range:
0 to 100
- Change:
Dynamic
- Tags:
Percentage of dirtied blocks from frees in one TXG
When to change: For zfs receive workloads, consider increasing or disabling. See ZFS I/O (ZIO) Scheduler
Notes: zfs_per_txg_dirty_frees_percent as a percentage of zfs_dirty_data_max controls the percentage of dirtied blocks from frees in one txg. After the threshold is crossed, additional dirty blocks from frees wait until the next txg. Thus, when deleting large files, filling consecutive txgs with deletes/frees, does not throttle other, perhaps more important, writes. A side effect of this throttle can impact zfs receive workloads that contain a large number of frees and the ignore_hole_birth optimization is disabled. The symptom is that the receive workload causes an increase in the frequency of txg commits. The frequency of txg commits is observable via the otime column of /proc/spl/kstat/zfs/POOLNAME/txgs. Since txg commits also flush data from volatile caches in HDDs to media, HDD performance can be negatively impacted. Also, since the frees do not consume much bandwidth over the pipe, the pipe can appear to stall. Thus the overall progress of receives is slower than expected. A value of zero will disable this throttle.
zfs_prefetch_disable
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0prefetch enabled
1prefetch disabled
- Change:
Dynamic
- Tags:
Disable all ZFS prefetching
When to change: In some case where the workload is completely random reads, overall performance can be better if prefetch is disabled
Verification: prefetch efficacy is observed by zarcstat and zarcsummary (arcstat and arc_summary before 2.4.0), and the relevant entries in /proc/spl/kstat/zfs/arcstats
Notes: zfs_prefetch_disable controls the predictive prefetcher. Note that it leaves “prescient” prefetch (eg prefetch for zfs send) intact (see zfs_pd_bytes_max)
zfs_qat_checksum_disable
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
int- Default:
0- Range:
0use QAT acceleration if available
1do not use QAT acceleration
- Change:
Dynamic
- Tags:
Enable/Disable QAT checksumming
When to change: Testing QAT functionality
Notes: zfs_qat_checksum_disable controls the Intel QuickAssist Technology (QAT) driver providing hardware acceleration for checksums. When the QAT hardware is present and qat driver available, the default behaviour is to enable QAT.
zfs_qat_compress_disable
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
int- Default:
0- Range:
0use QAT acceleration if available
1do not use QAT acceleration
- Change:
Dynamic
- Tags:
Enable/Disable QAT compression
When to change: Testing QAT functionality
Notes: zfs_qat_compress_disable controls the Intel QuickAssist Technology (QAT) driver providing hardware acceleration for gzip compression. When the QAT hardware is present and qat driver available, the default behaviour is to enable QAT.
zfs_qat_disable
- Versions:
v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Range:
0use QAT acceleration if available
1do not use QAT acceleration
- Change:
Dynamic
- Tags:
Disable QAT compression
When to change: Testing QAT functionality
Notes: zfs_qat_disable controls the Intel QuickAssist Technology (QAT) driver providing hardware acceleration for gzip compression. When the QAT hardware is present and qat driver available, the default behaviour is to enable QAT.
zfs_qat_encrypt_disable
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
int- Default:
0- Range:
0use QAT acceleration if available
1do not use QAT acceleration
- Change:
Dynamic
- Tags:
Enable/Disable QAT encryption
When to change: Testing QAT functionality
Notes: zfs_qat_encrypt_disable controls the Intel QuickAssist Technology (QAT) driver providing hardware acceleration for encryption. When the QAT hardware is present and qat driver available, the default behaviour is to enable QAT.
zfs_read_chunk_size
- Versions:
v0.6 - v0.8
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
1,048,576- Range:
512 to ULONG_MAX
- Change:
Dynamic
- Tags:
Bytes to read per chunk
Notes: zfs_read_chunk_size is the limit for ZFS filesystem reads. If an application issues a read() larger than zfs_read_chunk_size, then the read() is divided into multiple operations no larger than zfs_read_chunk_size
zfs_read_history
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
Historical statistics for the last N reads
When to change: To observe read operation details
Notes: Historical statistics for the last zfs_read_history reads are available in /proc/spl/kstat/zfs/POOL_NAME/reads
zfs_read_history_hits
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0do not include data for ARC hits
1include ARC hit data
- Change:
Dynamic
- Tags:
Include cache hits in read history
When to change: To observe read operation details with ARC hits
Notes: When zfs_read_history> 0, zfs_read_history_hits controls whether ARC hits are displayed in the read history file, /proc/spl/kstat/zfs/POOL_NAME/reads
zfs_rebuild_max_segment
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1048576- Change:
Dynamic
- Tags:
Max segment size in bytes of rebuild reads
zfs_rebuild_scrub_enabled
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Automatically scrub after sequential resilver completes
zfs_rebuild_vdev_limit
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
67108864- Change:
Dynamic
- Tags:
Max bytes in flight per leaf vdev for sequential resilvers
zfs_reconstruct_indirect_combinations_max
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
4096- Range:
0=do not limit attempts, 1 to MAX_INT = limit for attempts
- Change:
Dynamic
- Tags:
Maximum number of combinations when reconstructing split segments
Notes: After device removal, if an indirect split block contains more than zfs_reconstruct_indirect_combinations_max many possible unique combinations when being reconstructed, it can be considered too computationally expensive to check them all. Instead, at most zfs_reconstruct_indirect_combinations_max randomly-selected combinations are attempted each time the block is accessed. This allows all segment copies to participate fairly in the reconstruction when all combinations cannot be checked and prevents repeated use of one bad copy.
zfs_recover
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0normal operation
1attempt recovery zpool import
- Change:
Dynamic
- Tags:
Set to attempt to recover from fatal errors
When to change: zfs_recover should only be used as a last resort, as it typically results in leaked space, or worse
Verification: check output of dmesg and other logs for details
Notes: zfs_recover can be set to true (1) to attempt to recover from otherwise-fatal errors, typically caused by on-disk corruption. When set, calls to zfs_panic_recover() will turn into warning messages rather than calling panic()
zfs_recv_best_effort_corrective
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Ignore errors during corrective receive
zfs_recv_queue_ff
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
20- Change:
Dynamic
- Tags:
Receive queue fill fraction
zfs_recv_queue_length
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
16777216- Range:
Must be at least twice the maximum recordsize or volblocksize in use
- Change:
Dynamic
- Tags:
Maximum receive queue length
When to change: When using the largest recordsize or volblocksize (16 MiB), increasing can improve receive efficiency
zfs_recv_write_batch_size
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1048576- Change:
Dynamic
- Tags:
Maximum amount of writes to batch into one transaction
zfs_removal_ignore_errors
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
during device removal: 0 = hard errors are not ignored, 1 = hard errors are ignored
- Change:
Dynamic
- Tags:
Ignore hard IO errors when removing device
When to change: See description for caveat
Notes: When removing a device, zfs_removal_ignore_errors controls the process for handling hard I/O errors. When set, if a device encounters a hard IO error during the removal process the removal will not be cancelled. This can result in a normally recoverable block becoming permanently damaged and is not recommended. This should only be used as a last resort when the pool cannot be returned to a healthy state prior to removing the device.
zfs_removal_suspend_progress
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Range:
0 = do not suspend during vdev removal
- Change:
Dynamic
- Tags:
Pause device removal after this many bytes are copied (debug use only - causes removal to hang)
When to change: do not change
Notes: zfs_removal_suspend_progress is used during automated testing of the ZFS code to incease test coverage.
zfs_remove_max_segment
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
16777216- Range:
maximum of the physical block size of all vdevs in the pool to 16,777,216 bytes (16 MiB)
- Change:
Dynamic
- Tags:
Largest contiguous segment to allocate when removing device
When to change: after removing a top-level vdev, consider decreasing if there is a performance degradation when attempting to allocate large blocks
Notes: zfs_remove_max_segment sets the largest contiguous segment that ZFS attempts to allocate when removing a vdev. This can be no larger than 16MB. If there is a performance problem with attempting to allocate large blocks, consider decreasing this. The value is rounded up to a power-of-2.
zfs_resilver_defer_percent
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Change:
Dynamic
- Tags:
Issued IO percent complete after which resilvers are deferred
zfs_resilver_delay
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
2- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Number of ticks to delay resilver
When to change: increasing can reduce impact of resilver workload on dynamic workloads
Notes: zfs_resilver_delay sets a time-based delay for resilver I/Os. This delay is in addition to the ZIO scheduler’s treatment of scrub workloads. See also zfs_scan_idle
zfs_resilver_disable_defer
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0allow
resilver_deferto postpone new resilver operations1immediately restart resilver when needed
- Change:
Dynamic
- Tags:
Process all resilvers immediately
When to change: if resilver postponement is not desired due to overall resilver time constraints
Notes: zfs_resilver_disable_defer disables the resilver_defer pool feature. The resilver_defer feature allows ZFS to postpone new resilvers if an existing resilver is in progress.
zfs_resilver_min_time_ms
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.4 - master
1500v0.6 - v2.3
3,000- Range:
1 to zfs_txg_timeout converted to milliseconds
- Change:
Dynamic
- Tags:
Min millisecs to resilver per txg
When to change: In some resilvering cases, increasing zfs_resilver_min_time_ms can result in faster completion
Notes: Resilvers are processed by the sync thread in syncing context. While resilvering, ZFS spends at least zfs_resilver_min_time_ms time working on a resilver between txg commits. The zfs_txg_timeout tunable sets a nominal timeout value for the txg commits. By default, this timeout is 5 seconds and the zfs_resilver_min_time_ms is 3 seconds. However, many variables contribute to changing the actual txg times. The measured txg interval is observed as the otime column (in nanoseconds) in the /proc/spl/kstat/zfs/POOL_NAME/txgs file. See also zfs_txg_timeout and zfs_scan_min_time_ms (removed after v0.7)
zfs_scan_blkstats
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Enable block statistics calculation during scrub
zfs_scan_checkpoint_intval
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
7200- Range:
1 to INT_MAX
- Change:
Dynamic
- Tags:
Scan progress on-disk checkpointing interval
Notes: To preserve progress across reboots the sequential scan algorithm periodically needs to stop metadata scanning and issue all the verifications I/Os to disk every zfs_scan_checkpoint_intval seconds.
zfs_scan_fill_weight
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
3- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
Tunable to adjust bias towards more filled segments during scans
When to change: Testing sequential scrub and resilver
Notes: This tunable affects how scrub and resilver I/O segments are ordered. A higher number indicates that we care more about how filled in a segment is, while a lower number indicates we care more about the size of the extent without considering the gaps within a segment.
zfs_scan_idle
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
50- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Idle window in clock ticks
When to change: as part of a resilver/scrub tuning effort
Notes: When a non-scan I/O has occurred in the past zfs_scan_idle clock ticks, then zfs_resilver_delay or zfs_scrub_delay are enabled.
zfs_scan_ignore_errors
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0do not ignore errors
1ignore errors during pool scrub or resilver
- Change:
Dynamic
- Tags:
Ignore errors during resilver/scrub
When to change: See description above
Notes: zfs_scan_ignore_errors allows errors discovered during scrub or resilver to be ignored. This can be tuned as a workaround to remove the dirty time list (DTL) when completing a pool scan. It is intended to be used during pool repair or recovery to prevent resilvering when the pool is imported.
zfs_scan_issue_strategy
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Range:
0fs will use strategy 1 during normal verification and strategy 2 while taking a checkpoint
1data is verified as sequentially as possible, given the amount of memory reserved for scrubbing (see
zfs_scan_mem_lim_fact). This can improve scrub performance if the pool’s data is heavily fragmented2the largest mostly-contiguous chunk of found data is verified first. By deferring scrubbing of small segments, we may later find adjacent data to coalesce and increase the segment size
- Change:
Dynamic
- Tags:
IO issuing strategy during scrubbing. 0 = default, 1 = LBA, 2 = size
Notes: zfs_scan_issue_strategy controls the order of data verification while scrubbing or resilvering.
zfs_scan_legacy
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0use new method: scrubs and resilvers will gather metadata in memory before issuing sequential I/O
1use legacy algorithm will be used where I/O is initiated as soon as it is discovered
- Change:
Dynamic
- Tags:
Scrub using legacy non-sequential method
When to change: In some cases, the new scan mode can consumer more memory as it collects and sorts I/Os; using the legacy algorithm can be more memory efficient at the expense of HDD read efficiency
Notes: Setting zfs_scan_legacy = 1 enables the legacy scan and scrub behavior instead of the newer sequential behavior.
zfs_scan_max_ext_gap
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
2097152- Range:
512 to ULONG_MAX
- Change:
Dynamic
- Tags:
Max gap in bytes between sequential scrub / resilver I/Os
Notes: zfs_scan_max_ext_gap limits the largest gap in bytes between scrub and resilver I/Os that will still be considered sequential for sorting purposes.
zfs_scan_mem_lim_fact
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
20- Change:
Dynamic
- Tags:
Fraction of RAM for scan hard limit
Notes: zfs_scan_mem_lim_fact limits the maximum fraction of RAM used for I/O sorting by sequential scan algorithm. When the limit is reached scanning metadata is stopped and data verification I/O is started. Data verification I/O continues until the memory used by the sorting algorithm drops by zfs_scan_mem_lim_soft_fact Memory used by the sequential scan algorithm can be observed as the kmem sio_cache. This is visible from procfs as grep sio_cache /proc/slabinfo and can be monitored using slab-monitoring tools such as slabtop
zfs_scan_mem_lim_soft_fact
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
20- Range:
1 to INT_MAX
- Change:
Dynamic
- Tags:
Fraction of hard limit used as soft limit
Notes: zfs_scan_mem_lim_soft_fact sets the fraction of the hard limit, zfs_scan_mem_lim_fact, used to determined the RAM soft limit for I/O sorting by the sequential scan algorithm. After zfs_scan_mem_lim_fact has been reached, metadata scanning is stopped until the RAM usage drops by zfs_scan_mem_lim_soft_fact
zfs_scan_min_time_ms
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1,000- Range:
1 to zfs_txg_timeout converted to milliseconds
- Change:
Dynamic
- Tags:
Min millisecs to scrub per txg
When to change: In some scrub cases, increasing zfs_scan_min_time_ms can result in faster completion
Notes: Scrubs are processed by the sync thread in syncing context. While scrubbing, ZFS spends at least zfs_scan_min_time_ms time working on a scrub between txg commits. See also zfs_txg_timeout and zfs_resilver_min_time_ms
zfs_scan_report_txgs
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Change:
Dynamic
- Tags:
Tunable to report resilver performance over the last N txgs
zfs_scan_strict_mem_lim
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0normal scan behaviour
1check hard memory limit strictly during scan
- Change:
Dynamic
- Tags:
Tunable to attempt to reduce lock contention
When to change: Do not change
Notes: When scrubbing or resilvering, by default, ZFS checks to ensure it is not over the hard memory limit before each txg commit. If finer-grained control of this is needed zfs_scan_strict_mem_lim can be set to 1 to enable checking before scanning each block.
zfs_scan_suspend_progress
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0do not freeze scans
1freeze scans
- Change:
Dynamic
- Tags:
Set to prevent scans from progressing
When to change: testing or debugging scan code
Notes: zfs_scan_suspend_progress causes a scrub or resilver scan to freeze without actually pausing.
zfs_scan_vdev_limit
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.1 - master
16777216v0.8 - v2.0
41943040- Range:
512 to ULONG_MAX
- Change:
Dynamic
- Tags:
Max bytes in flight per leaf vdev for scrubs and resilvers
Notes: zfs_scan_vdev_limit is the maximum amount of data that can be concurrently issued at once for scrubs and resilvers per leaf vdev. zfs_scan_vdev_limit attempts to strike a balance between keeping the leaf vdev queues full of I/Os while not overflowing the queues causing high latency resulting in long txg sync times. While zfs_scan_vdev_limit represents a bandwidth limit, the existing I/O limit of zfs_vdev_scrub_max_active remains in effect, too.
zfs_scrub_after_expand
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
For expanded RAIDZ, automatically start a pool scrub when expansion completes
zfs_scrub_delay
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
4- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Number of ticks to delay scrub
When to change: increasing can reduce impact of scrub workload on dynamic workloads
Notes: zfs_scrub_delay sets a time-based delay for scrub I/Os. This delay is in addition to the ZIO scheduler’s treatment of scrub workloads. See also zfs_scan_idle
zfs_scrub_error_blocks_per_txg
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
4096- Change:
Dynamic
- Tags:
Error blocks to be scrubbed in one txg
zfs_scrub_min_time_ms
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.4 - master
750v0.8 - v2.3
1,000- Range:
1 to (zfs_txg_timeout - 1)
- Change:
Dynamic
- Tags:
Min millisecs to scrub per txg
Notes: Scrubs are processed by the sync thread. While scrubbing at least zfs_scrub_min_time_ms time is spent working on a scrub between txg syncs.
zfs_scrub_partial_writes
- Versions:
master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Issue reads after writes with recoverable failures to ensure integrity
zfs_send_corrupt_data
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0do not send corrupt data
1replace corrupt data with cookie
- Change:
Dynamic
- Tags:
Allow sending corrupt data
When to change: When data corruption exists and an attempt to recover at least some data via zfs send is needed
Notes: zfs_send_corrupt_data enables zfs send to send of corrupt data by ignoring read and checksum errors. The corrupted or unreadable blocks are replaced with the value 0x2f5baddb10c (ZFS bad block)
zfs_send_no_prefetch_queue_ff
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
20- Change:
Dynamic
- Tags:
Send queue fill fraction for non-prefetch queues
zfs_send_no_prefetch_queue_length
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1048576- Change:
Dynamic
- Tags:
Maximum send queue length for non-prefetch queues
zfs_send_queue_ff
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
20- Change:
Dynamic
- Tags:
Send queue fill fraction
zfs_send_queue_length
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
16777216- Range:
Must be at least twice the maximum recordsize or volblocksize in use
- Change:
Dynamic
- Tags:
Maximum send queue length
When to change: When using the largest recordsize or volblocksize (16 MiB), increasing can improve send efficiency
Notes: zfs_send_queue_length is the maximum number of bytes allowed in the zfs send queue.
zfs_send_unmodified_spill_blocks
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not send unmodified spill blocks
1send unmodified spill blocks
- Change:
Dynamic
- Tags:
Send unmodified spill blocks
Notes: zfs_send_unmodified_spill_blocks enables sending of unmodified spill blocks in the send stream. Under certain circumstances, previous versions of ZFS could incorrectly remove the spill block from an existing object. Including unmodified copies of the spill blocks creates a backwards compatible stream which will recreate a spill block if it was incorrectly removed.
zfs_slow_io_events_per_second
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
20- Range:
zedthreshold to MAX_UINT- Change:
Dynamic
- Tags:
Rate limit slow IO (delay) events to this many per second
Notes: zfs_slow_io_events_per_second is a rate limit for slow I/O events. Note that this should not be set below the zed thresholds (currently 10 checksums over 10 sec) or else zed may not trigger any action.
zfs_snapshot_history_enabled
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Include snapshot events in pool history/events
zfs_snapshot_no_setuid
- Versions:
v2.3 - master
- Platforms:
Linux
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Disable setuid/setgid for automounts in .zfs/snapshot
zfs_spa_discard_memory_limit
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
16777216- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Limit for memory used in prefetching the checkpoint space map done on each vdev while discarding the checkpoint
zfs_special_class_metadata_reserve_pct
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
25- Range:
0 to 100
- Change:
Dynamic
- Tags:
Small file blocks in special vdevs depends on this much free space available
Notes: zfs_special_class_metadata_reserve_pct sets a threshold for space in special vdevs to be reserved exclusively for metadata. This prevents small data blocks from completely consuming a special vdev.
zfs_sync_pass_deferred_free
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
2- Range:
1 to INT_MAX
- Change:
Dynamic
- Tags:
Defer frees starting in this pass
When to change: Testing SPA sync process
Notes: The SPA sync process is performed in multiple passes. Once the pass number reaches zfs_sync_pass_deferred_free, frees are no long processed and must wait for the next SPA sync. The zfs_sync_pass_deferred_free value is expected to be removed as a tunable once the optimal value is determined during field testing. The zfs_sync_pass_deferred_free pass must be greater than 1 to ensure that regular blocks are not deferred.
zfs_sync_pass_dont_compress
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v0.8 - master
8v0.6 - v0.7
5- Range:
1 to INT_MAX
- Change:
Dynamic
- Tags:
Don’t compress starting in this pass
When to change: Testing SPA sync process
Notes: The SPA sync process is performed in multiple passes. Once the pass number reaches zfs_sync_pass_dont_compress, data block compression is no longer processed and must wait for the next SPA sync. The zfs_sync_pass_dont_compress value is expected to be removed as a tunable once the optimal value is determined during field testing.
zfs_sync_pass_rewrite
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
2- Range:
1 to INT_MAX
- Change:
Dynamic
- Tags:
Rewrite new bps starting in this pass
When to change: Testing SPA sync process
Notes: The SPA sync process is performed in multiple passes. Once the pass number reaches zfs_sync_pass_rewrite, blocks can be split into gang blocks. The zfs_sync_pass_rewrite value is expected to be removed as a tunable once the optimal value is determined during field testing.
zfs_sync_taskq_batch_pct
- Versions:
v0.7 - v2.2
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
75- Range:
1 to 100
- Change:
Dynamic
- Tags:
Max percent of CPUs that are used to sync dirty data
When to change: to adjust the number of dp_sync_taskq threads
Notes: zfs_sync_taskq_batch_pct controls the number of threads used by the DSL pool sync taskq, dp_sync_taskq
zfs_top_maxinflight
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
32- Range:
1 to MAX_INT
- Change:
Dynamic
- Tags:
Max I/Os per top-level
When to change: for modern ZFS versions, the ZIO scheduler limits usually take precedence
Notes: zfs_top_maxinflight is used to limit the maximum number of I/Os queued to top-level vdevs during scrub or resilver operations. The actual top-level vdev limit is calculated by multiplying the number of child vdevs by zfs_top_maxinflight This limit is an additional cap over and above the scan limits
zfs_traverse_indirect_prefetch_limit
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
32- Change:
Dynamic
- Tags:
Traverse prefetch number of blocks pointed by indirect block
zfs_trim_extent_bytes_max
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
134217728- Range:
zfs_trim_extent_bytes_min to MAX_UINT
- Change:
Dynamic
- Tags:
Max size of TRIM commands, larger will be split
When to change: if the device can efficiently handle larger trim requests
Notes: zfs_trim_extent_bytes_max sets the maximum size of a trim (aka discard, scsi unmap) command. Ranges larger than zfs_trim_extent_bytes_max are split in to chunks no larger than zfs_trim_extent_bytes_max bytes prior to being issued to the device. Use zpool iostat -w to observe the latency of trim commands.
zfs_trim_extent_bytes_min
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
32768- Range:
0=trim all unallocated space, otherwise minimum physical block size to UINT_MAX
- Change:
Dynamic
- Tags:
Min size of TRIM commands, smaller will be skipped
When to change: when trim is in use and device performance suffers from trimming small allocations
Notes: zfs_trim_extent_bytes_min sets the minimum size of trim (aka discard, scsi unmap) commands. Trim ranges smaller than zfs_trim_extent_bytes_min are skipped unless they’re part of a larger range which was broken in to chunks. Some devices have performance degradation during trim operations, so using a larger zfs_trim_extent_bytes_min can reduce the total amount of space trimmed. Use zpool iostat -w to observe the latency of trim commands.
zfs_trim_metaslab_skip
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Range:
0do not skip uninitialized metaslabs during trim
1skip uninitialized metaslabs during trim
- Change:
Dynamic
- Tags:
Skip metaslabs which have never been initialized
Notes: zfs_trim_metaslab_skip enables uninitialized metaslabs to be skipped during the trim (aka discard, scsi unmap) process. zfs_trim_metaslab_skip can be useful for pools constructed from large thinly-provisioned devices where trim operations perform slowly. As a pool ages an increasing fraction of the pool’s metaslabs are initialized, progressively degrading the usefulness of this option. This setting is stored when starting a manual trim and persists for the duration of the requested trim. Use zpool iostat -w to observe the latency of trim commands.
zfs_trim_queue_limit
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Range:
1 to MAX_UINT
- Change:
Dynamic
- Tags:
Max queued TRIMs outstanding per leaf vdev
When to change: to restrict the number of trim commands in the queue
Notes: zfs_trim_queue_limit sets the maximum queue depth for leaf vdevs. See also zfs_vdev_trim_max_active and zfs_trim_extent_bytes_max Use zpool iostat -q to observe trim queue depth.
zfs_trim_txg_batch
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
32- Range:
1 to MAX_UINT
- Change:
Dynamic
- Tags:
Min number of txgs to aggregate frees before issuing TRIM
Notes: zfs_trim_txg_batch sets the number of transaction groups worth of frees which should be aggregated before trim (aka discard, scsi unmap) commands are issued to a device. This setting represents a trade-off between issuing larger, more efficient trim commands and the delay before the recently trimmed space is available for use by the device. Increasing this value will allow frees to be aggregated for a longer time. This will result is larger trim operations and potentially increased memory usage. Decreasing this value will have the opposite effect. The default value of 32 was empirically determined to be a reasonable compromise.
zfs_txg_history
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.3 - master
100v0.6 - v2.2
0- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
Historical statistics for the last N txgs
When to change: To observe details of SPA sync behavior.
Notes: Historical statistics for the last zfs_txg_history txg commits are available in /proc/spl/kstat/zfs/POOL_NAME/txgs The work required to measure the txg commit (SPA statistics) is low. However, for debugging purposes, it can be useful to observe the SPA statistics.
zfs_txg_timeout
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
5- Range:
1 to INT_MAX
- Change:
Dynamic
- Tags:
Max seconds worth of delta per txg
When to change: To optimize the work done by txg commit relative to the pool requirements. See also section ZFS I/O Scheduler
Notes: The open txg is committed to the pool periodically (SPA sync) and zfs_txg_timeout represents the default target upper limit. txg commits can occur more frequently and a rapid rate of txg commits often indicates a busy write workload, quota limits reached, or the free space is critically low. Many variables contribute to changing the actual txg times. txg commits can also take longer than zfs_txg_timeout if the ZFS write throttle is not properly tuned or the time to sync is otherwise delayed (eg slow device). Shorter txg commit intervals can occur due to zfs_dirty_data_sync_percent for write-intensive workloads. The measured txg interval is observed as the otime column (in nanoseconds) in the /proc/spl/kstat/zfs/POOL_NAME/txgs file. See also zfs_dirty_data_sync_percent and zfs_txg_history
zfs_unflushed_log_block_max
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.1 - master
131072v2.0
262144 (256K)- Change:
Dynamic
- Tags:
Hard limit (upper-bound) in the size of the space map log in terms of blocks.
zfs_unflushed_log_block_min
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1000- Change:
Dynamic
- Tags:
Lower-bound limit for the maximum amount of blocks allowed in log spacemap (see zfs_unflushed_log_block_max)
zfs_unflushed_log_block_pct
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
400- Change:
Dynamic
- Tags:
Tunable used to determine the number of blocks that can be used for the spacemap log, expressed as a percentage of the total number of metaslabs in the pool (e.g. 400 means the number of log blocks is capped at 4 times the number of metaslabs)
zfs_unflushed_log_txg_max
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1000- Change:
Dynamic
- Tags:
Hard limit (upper-bound) in the size of the space map log in terms of dirty TXGs.
zfs_unflushed_max_mem_amt
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1073741824- Change:
Dynamic
- Tags:
Specific hard-limit in memory that ZFS allows to be used for unflushed changes
zfs_unflushed_max_mem_ppm
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
1000- Change:
Dynamic
- Tags:
Percentage of the overall system memory that ZFS allows to be used for unflushed changes (value is calculated over 1000000 for finer granularity)
zfs_unlink_suspend_progress
- Versions:
v0.8 - master
- Platforms:
Linux
- Type:
int- Default:
0- Range:
0use async unlink removal
1do not async unlink thus leaking space
- Change:
Dynamic
- Tags:
Set to prevent async unlinks (debug - leaks space into the unlinked set)
When to change: used by the ZFS test suite (ZTS) to facilitate testing
Notes: zfs_unlink_suspend_progress changes the policy for removing pending unlinks. When enabled, files will not be asynchronously removed from the list of pending unlinks and the space they consume will be leaked. Once this option has been disabled and the dataset is remounted, the pending unlinks will be processed and the freed space returned to the pool.
zfs_user_indirect_is_special
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not write user indirect blocks to a special vdev
1write user indirect blocks to a special vdev
- Change:
Dynamic
- Tags:
Place user data indirect blocks into the special class
When to change: to force user data indirect blocks to remain in the main pool top-level vdevs
Notes: If special vdevs are in use, zfs_user_indirect_is_special enables user data indirect blocks (a form of metadata) to be written to the special vdevs.
zfs_vdev_aggregate_trim
- Versions:
v0.8 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0do not attempt to aggregate trim commands
1attempt to aggregate trim commands
- Change:
Dynamic
- Tags:
Allow TRIM I/O to be aggregated
When to change: when debugging trim code or trim performance issues
Notes: zfs_vdev_aggregate_trim allows trim I/Os to be aggregated. This is normally not helpful because the extents to be trimmed will have been already been aggregated by the metaslab.
zfs_vdev_aggregation_limit
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v0.8 - master
1,048,576v0.6 - v0.7
131,072- Range:
0 to 1,048,576 (default) or 16,777,216 (if
zpoollarge_blocksfeature is enabled)- Change:
Dynamic
- Tags:
Max vdev I/O aggregation size
When to change: If the workload does not benefit from aggregation, the zfs_vdev_aggregation_limit can be reduced to avoid aggregation attempts
Verification: ZFS aggregation is observed with zpool iostat -r and the block scheduler merging is observed with iostat -x
Notes: To reduce IOPs, small, adjacent I/Os can be aggregated (coalesced) into a large I/O. For reads, aggregations occur across small adjacency gaps. For writes, aggregation can occur at the ZFS or disk level. zfs_vdev_aggregation_limit is the upper bound on the size of the larger, aggregated I/O. Setting zfs_vdev_aggregation_limit = 0 effectively disables aggregation by ZFS. However, the block device scheduler can still merge (aggregate) I/Os. Also, many devices, such as modern HDDs, contain schedulers that can aggregate I/Os. In general, I/O aggregation can improve performance for devices, such as HDDs, where ordering I/O operations for contiguous LBAs is a benefit. For random access devices, such as SSDs, aggregation might not improve performance relative to the CPU cycles needed to aggregate. For devices that represent themselves as having no rotation, the zfs_vdev_aggregation_limit_non_rotating parameter is used instead of zfs_vdev_aggregation_limit
zfs_vdev_aggregation_limit_non_rotating
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
131072- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Max vdev I/O aggregation size for non-rotating media
When to change: see zfs_vdev_aggregation_limit
Notes: zfs_vdev_aggregation_limit_non_rotating is the equivalent of zfs_vdev_aggregation_limit for devices which represent themselves as non-rotating to the Linux blkdev interfaces. Such devices have a value of 0 in /sys/block/DEVICE/queue/rotational and are expected to be SSDs.
zfs_vdev_async_read_max_active
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
3- Range:
1 to zfs_vdev_max_active
- Change:
Dynamic
- Tags:
Max active async read I/Os per vdev
When to change: See ZFS I/O Scheduler
zfs_vdev_async_read_min_active
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Range:
1 to ( zfs_vdev_async_read_max_active - 1)
- Change:
Dynamic
- Tags:
Min active async read I/Os per vdev
When to change: See ZFS I/O Scheduler
zfs_vdev_async_write_active_max_dirty_percent
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
60- Range:
0 to 100
- Change:
Dynamic
- Tags:
Async write concurrency max threshold
When to change: See ZFS I/O Sch eduler
Notes: When the amount of dirty data exceeds the threshold zfs_vdev_async_write_active_max_dirty_percent of zfs_dirty_data_max dirty data, then zfs_vdev_async_write_max_active is used to limit active async writes. If the dirty data is between zfs_vdev_async_write_active_min_dirty_percent and zfs_vdev_async_write_active_max_dirty_percent, the active I/O limit is linearly interpolated between zfs_vdev_async_write_min_active and zfs_vdev_async_write_max_active
zfs_vdev_async_write_active_min_dirty_percent
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
30- Range:
0 to (zfs_vdev_async_write_active_max_dirty_percent - 1)
- Change:
Dynamic
- Tags:
Async write concurrency min threshold
When to change: See ZFS I/O Sch eduler
Notes: If the amount of dirty data is between zfs_vdev_async_write_active_min_dirty_percent and zfs_vdev_async_write_active_max_dirty_percent of zfs_dirty_data_max, the active I/O limit is linearly interpolated between zfs_vdev_async_write_min_active and zfs_vdev_async_write_max_active
zfs_vdev_async_write_max_active
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.2 - master
10v2.1
30v0.6 - v2.0
10- Range:
1 to zfs_vdev_max_active
- Change:
Dynamic
- Tags:
Max active async write I/Os per vdev
When to change: See ZFS I/O S cheduler
zfs_vdev_async_write_min_active
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v0.7 - master
2v0.6
1- Range:
1 to zfs_vdev_async_write_max_active
- Change:
Dynamic
- Tags:
Min active async write I/Os per vdev
When to change: See ZFS I/O S cheduler
Notes: zfs_vdev_async_write_min_active sets the minimum asynchronous write I/Os active to each device. Lower values are associated with better latency on rotational media but poorer resilver performance. The default value of 2 was chosen as a compromise. A value of 3 has been shown to improve resilver performance further at a cost of further increasing latency.
zfs_vdev_cache_bshift
- Versions:
v0.6 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
16- Range:
1 to INT_MAX
- Change:
Dynamic
- Tags:
Shift size to inflate reads too
When to change: Do not change
Notes: Note: with the current ZFS code, the vdev cache is not helpful and in some cases actually harmful. Thus it is disabled by setting the zfs_vdev_cache_size to zero. This related tunable is, by default, inoperative. All read I/Os smaller than zfs_vdev_cache_max are turned into (1 << zfs_vdev_cache_bshift) byte reads by the vdev cache. At most zfs_vdev_cache_size bytes will be kept in each vdev’s cache.
zfs_vdev_cache_max
- Versions:
v0.6 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
16384- Range:
512 to INT_MAX
- Change:
Dynamic
- Tags:
Inflate reads small than max
When to change: Do not change
Notes: Note: with the current ZFS code, the vdev cache is not helpful and in some cases actually harmful. Thus it is disabled by setting the zfs_vdev_cache_size to zero. This related tunable is, by default, inoperative. All read I/Os smaller than zfs_vdev_cache_max will be turned into (1 <<zfs_vdev_cache_bshift byte reads by the vdev cache. At most zfs_vdev_cache_size bytes will be kept in each vdev’s cache.
zfs_vdev_cache_size
- Versions:
v0.6 - v2.1
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0 to MAX_INT
- Change:
Prior to module load
- Tags:
Total size of the per-disk cache
When to change: Do not change
Verification: vdev cache statistics are available in the /proc/spl/kstat/zfs/vdev_cache_stats file
Notes: Note: with the current ZFS code, the vdev cache is not helpful and in some cases actually harmful. Thusit is disabled by setting the zfs_vdev_cache_size = 0 zfs_vdev_cache_size is the size of the vdev cache.
zfs_vdev_def_queue_depth
- Versions:
v2.2 - v2.3
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
32- Change:
Dynamic
- Tags:
Default queue depth for each allocator
zfs_vdev_default_ms_count
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
200- Range:
16 to MAX_INT
- Change:
Dynamic
- Tags:
Target number of metaslabs per top-level vdev
When to change: for development testing purposes only
zfs_vdev_default_ms_shift
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
29- Change:
Dynamic
- Tags:
Default lower limit for metaslab size
zfs_vdev_direct_write_verify
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
Linux- Change:
Dynamic
- Tags:
Direct I/O writes will perform for checksum verification before commiting write
zfs_vdev_disk_calling_thread_io
Enable calling thread io
zfs_vdev_disk_classic
- Versions:
v2.2 - v2.3
- Platforms:
Linux
- Type:
uint- Default:
0- Change:
Prior to module load
- Tags:
Use classic BIO submission method
zfs_vdev_disk_max_segs
- Versions:
v2.2 - master
- Platforms:
Linux
- Type:
uint- Default:
0- Change:
Dynamic
- Tags:
Maximum number of data segments to add to an IO request (min 4)
zfs_vdev_failfast_mask
- Versions:
v2.2 - master
- Platforms:
Linux
- Type:
uint- Default:
1- Change:
Dynamic
- Tags:
Defines failfast mask: 1 - device, 2 - transport, 4 - driver
zfs_vdev_initializing_max_active
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Range:
1 to zfs_vdev_max_active
- Change:
Dynamic
- Tags:
Max active initializing I/Os per vdev
When to change: See ZFS I/O Sch eduler
zfs_vdev_initializing_min_active
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Range:
1 to zfs_vdev_initializing_max_active
- Change:
Dynamic
- Tags:
Min active initializing I/Os per vdev
When to change: See ZFS I/O Sch eduler
zfs_vdev_max_active
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1000- Range:
sum of each queue’s min_active to UINT32_MAX
- Change:
Dynamic
- Tags:
Maximum number of active I/Os per vdev
When to change: See ZFS I/O Scheduler
Notes: The maximum number of I/Os active to each device. Ideally, zfs_vdev_max_active >= the sum of each queue’s max_active. Once queued to the device, the ZFS I/O scheduler is no longer able to prioritize I/O operations. The underlying device drivers have their own scheduler and queue depth limits. Values larger than the device’s maximum queue depth can have the affect of increased latency as the I/Os are queued in the intervening device driver layers.
zfs_vdev_max_auto_ashift
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.1 - master
14v2.0
ASHIFT_MAX (16)- Change:
Dynamic
- Tags:
Maximum ashift used when optimizing for logical -> physical sector size on new top-level vdevs
zfs_vdev_max_ms_shift
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
34- Change:
Dynamic
- Tags:
Default upper limit for metaslab size
zfs_vdev_min_auto_ashift
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
ASHIFT_MIN- Change:
Dynamic
- Tags:
Minimum ashift used when creating new top-level vdevs
zfs_vdev_min_ms_count
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
16- Range:
16 to zfs_vdev_ms_count_limit
- Change:
Dynamic
- Tags:
Minimum number of metaslabs per top-level vdev
zfs_vdev_mirror_non_rotating_inc
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
mirror, SSD, vdev, vdev_mirror
Non-rotating media load increment for non-seeking I/Os
Notes: The mirror read algorithm uses current load and an incremental weighting value to determine the vdev to service a read operation. Lower values determine the preferred vdev. The weighting value is zfs_vdev_mirror_rotating_inc for rotating media and zfs_vdev_mirror_non_rotating_inc for nonrotating media. Verify the rotational setting described by a block device in sysfs by observing /sys/block/DISK_NAME/queue/rotational
zfs_vdev_mirror_non_rotating_seek_inc
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
mirror, SSD, vdev, vdev_mirror
Non-rotating media load increment for seeking I/Os
Notes: For nonrotating media in a mirror, a seek penalty is applied as sequential I/O’s can be aggregated into fewer operations, avoiding unnecessary per-command overhead, often boosting performance. Verify the rotational setting described by a block device in SysFS by observing /sys/block/DISK_NAME/queue/rotational
zfs_vdev_mirror_rotating_inc
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
HDD, mirror, vdev, vdev_mirror
Rotating media load increment for non-seeking I/Os
When to change: Increasing for mirrors with both rotating and nonrotating media more strongly favors the nonrotating media
Notes: The mirror read algorithm uses current load and an incremental weighting value to determine the vdev to service a read operation. Lower values determine the preferred vdev. The weighting value is zfs_vdev_mirror_rotating_inc for rotating media and zfs_vdev_mirror_non_rotating_inc for nonrotating media. Verify the rotational setting described by a block device in sysfs by observing /sys/block/DISK_NAME/queue/rotational
zfs_vdev_mirror_rotating_seek_inc
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
5- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
HDD, mirror, vdev, vdev_mirror
Rotating media load increment for seeking I/Os
Notes: For rotating media in a mirror, if the next I/O offset is within zfs_vdev_mirror_rotating_seek_offset then the weighting factor is incremented by (zfs_vdev_mirror_rotating_seek_inc / 2). Otherwise the weighting factor is increased by zfs_vdev_mirror_rotating_seek_inc. This algorithm prefers rotating media with lower seek distance. Verify the rotational setting described by a block device in sysfs by observing /sys/block/DISK_NAME/queue/rotational
zfs_vdev_mirror_rotating_seek_offset
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1048576- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
HDD, mirror, vdev, vdev_mirror
Offset in bytes from the last I/O which triggers a reduced rotating media seek increment
Notes: For rotating media in a mirror, if the next I/O offset is within zfs_vdev_mirror_rotating_seek_offset then the weighting factor is incremented by (zfs_vdev_mirror_rotating_seek_inc/ 2). Otherwise the weighting factor is increased by zfs_vdev_mirror_rotating_seek_inc. This algorithm prefers rotating media with lower seek distance. Verify the rotational setting described by a block device in sysfs by observing /sys/block/DISK_NAME/queue/rotational
zfs_vdev_mirror_switch_us
- Versions:
v0.6
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
10,000- Change:
Dynamic
- Tags:
Switch mirrors every N usecs
zfs_vdev_ms_count_limit
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
131072- Range:
zfs_vdev_min_ms_count to 131,072
- Change:
Dynamic
- Tags:
Practical upper limit of total metaslabs per top-level vdev
zfs_vdev_nia_credit
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
5- Range:
1 to UINT_MAX
- Change:
Dynamic
- Tags:
Number of non-interactive I/Os to allow in sequence
When to change: See ZIO SCHEDULER
Notes: Some HDDs tend to prioritize sequential I/O so strongly, that concurrent random I/O latency reaches several seconds. On some HDDs this happens even if sequential I/O operations are submitted one at a time, and so setting zfs_*_max_active= 1 does not help. To prevent non-interactive I/O, like scrub, from monopolizing the device, no more than zfs_vdev_nia_credit operations can be sent while there are outstanding incomplete interactive operations. This enforced wait ensures the HDD services the interactive I/O within a reasonable amount of time. See ZIO SCHEDULER.
zfs_vdev_nia_delay
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
5- Range:
1 to UINT_MAX
- Change:
Dynamic
- Tags:
delay, resilver, scrub, vdev, vdev_queue
Number of non-interactive I/Os before _max_active
When to change: See ZIO SCHEDULER
Notes: For non-interactive I/O (scrub, resilver, removal, initialize and rebuild), the number of concurrently-active I/O operations is limited to zfs_*_min_active, unless the vdev is “idle”. When there are no interactive I/O operations active (synchronous or otherwise), and zfs_vdev_nia_delay operations have completed since the last interactive operation, then the vdev is considered to be “idle”, and the number of concurrently-active non-interactive operations is increased to zfs_*_max_active. See ZIO SCHEDULER.
zfs_vdev_open_timeout_ms
- Versions:
v2.1 - master
- Platforms:
Linux
- Type:
uint- Default:
1000- Change:
Dynamic
- Tags:
Timeout before determining that a device is missing
zfs_vdev_queue_depth_pct
- Versions:
v0.7 - v2.3
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1000- Range:
1 to UINT32_MAX
- Change:
Dynamic
- Tags:
Queue depth percentage for each top-level vdev
When to change: See ZFS I/O Scheduler
Notes: Maximum number of queued allocations per top-level vdev expressed as a percentage of zfs_vdev_async_write_max_active. This allows the system to detect devices that are more capable of handling allocations and to allocate more blocks to those devices. It also allows for dynamic allocation distribution when devices are imbalanced as fuller devices will tend to be slower than empty devices. Once the queue depth reaches (zfs_vdev_queue_depth_pct * zfs_vdev_async_write_max_active / 100) then allocator will stop allocating blocks on that top-level device and switch to the next. See also zio_dva_throttle_enabled
zfs_vdev_raidz_impl
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
string- Default:
fastest- Range:
fastestfastest implementation selected by microbenchmark
originaloriginal raidz implementation
scalarscalar raidz implementation
sse2uses the SSE2 instruction set, 64-bit x86
ssse3uses the SSSE3 instruction set, 64-bit x86
avx2uses the AVX2 instruction set, 64-bit x86
avx512fuses the AVX512F instruction set, 64-bit x86
avx512bwuses the AVX512F and AVX512BW instruction sets, 64-bit x86
aarch64_neonuses NEON, aarch64/64 bit ARMv8
aarch64_neonx2uses NEON with more unrolling, aarch64/64 bit ARMv8
- Change:
Dynamic
- Tags:
RAIDZ implementation
When to change: testing raidz algorithms
Notes: zfs_vdev_raidz_impl overrides the raidz parity algorithm. By default, the algorithm is selected at zfs module load time by the results of a microbenchmark of algorithms based on the current hardware. Once the module is loaded, the content of /sys/module/zfs/parameters/zfs_vdev_raidz_impl shows available options with the currently selected enclosed in []. Details of the results of the microbenchmark are observable in the /proc/spl/kstat/zfs/vdev_raidz_bench file.
zfs_vdev_read_gap_limit
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
32768- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
Aggregate read I/O over gap
Notes: To reduce IOPs, small, adjacent I/Os are aggregated (coalesced) into into a large I/O. For reads, aggregations occur across small adjacency gaps where the gap is less than zfs_vdev_read_gap_limit
zfs_vdev_rebuild_max_active
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
3- Change:
Dynamic
- Tags:
Max active rebuild I/Os per vdev
zfs_vdev_rebuild_min_active
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Change:
Dynamic
- Tags:
Min active rebuild I/Os per vdev
zfs_vdev_removal_max_active
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
2- Range:
1 to zfs_vdev_max_active
- Change:
Dynamic
- Tags:
Max active removal I/Os per vdev
When to change: See ZFS I/O Scheduler
zfs_vdev_removal_min_active
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Range:
1 to zfs_vdev_removal_max_active
- Change:
Dynamic
- Tags:
Min active removal I/Os per vdev
When to change: See ZFS I/O Scheduler
zfs_vdev_scheduler
- Versions:
v0.6 - v2.3
- Platforms:
Linux
- Type:
charp- Range:
expected: noop, cfq, bfq, and deadline
- Change:
Dynamic
- Tags:
I/O scheduler
When to change: since ZFS has its own I/O scheduler, using a simple scheduler can result in more consistent performance
Notes: Prior to version 0.8.3, when the pool is imported, for whole disk vdevs, the block device I/O scheduler is set to zfs_vdev_scheduler. The most common schedulers are: noop, cfq, bfq, and deadline. In some cases, the scheduler is not changeable using this method. Known schedulers that cannot be changed are: scsi_mq and none. In these cases, the scheduler is unchanged and an error message can be reported to logs. The parameter was disabled in v0.8.3 but left in place to avoid breaking loading of the zfs module if the parameter is specified in modprobe configuration on existing installations. It is recommended that users leave the default scheduler “unless you’re encountering a specific problem, or have clearly measured a performance improvement for your workload,” and if so, to change it via the /sys/block/<device>/queue/scheduler interface and/or udev rule.
zfs_vdev_scrub_max_active
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
2- Range:
1 to zfs_vdev_max_active
- Change:
Dynamic
- Tags:
Max active scrub I/Os per vdev
When to change: See ZFS I/O Scheduler
Notes: zfs_vdev_scrub_max_active sets the maximum scrub or scan read I/Os active to each device.
zfs_vdev_scrub_min_active
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Range:
1 to zfs_vdev_scrub_max_active
- Change:
Dynamic
- Tags:
Min active scrub I/Os per vdev
When to change: See ZFS I/O Scheduler
Notes: zfs_vdev_scrub_min_active sets the minimum scrub or scan read I/Os active to each device.
zfs_vdev_sync_read_max_active
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Range:
1 to zfs_vdev_max_active
- Change:
Dynamic
- Tags:
Max active sync read I/Os per vdev
When to change: See ZFS I/O Scheduler
zfs_vdev_sync_read_min_active
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Range:
1 to zfs_vdev_sync_read_max_active
- Change:
Dynamic
- Tags:
Min active sync read I/Os per vdev
When to change: See ZFS I/O Scheduler
zfs_vdev_sync_write_max_active
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Range:
1 to zfs_vdev_max_active
- Change:
Dynamic
- Tags:
Max active sync write I/Os per vdev
When to change: See ZFS I/O Scheduler
zfs_vdev_sync_write_min_active
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
10- Range:
1 to zfs_vdev_sync_write_max_active
- Change:
Dynamic
- Tags:
Min active sync write I/Os per vdev
When to change: See ZFS I/O Scheduler
zfs_vdev_trim_max_active
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
2- Range:
1 to zfs_vdev_max_active
- Change:
Dynamic
- Tags:
Max active trim/discard I/Os per vdev
When to change: See ZFS I/O Scheduler
Notes: zfs_vdev_trim_max_active sets the maximum trim I/Os active to each device.
zfs_vdev_trim_min_active
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Range:
1 to zfs_vdev_trim_max_active
- Change:
Dynamic
- Tags:
Min active trim/discard I/Os per vdev
When to change: See ZFS I/O Scheduler
Notes: zfs_vdev_trim_min_active sets the minimum trim I/Os active to each device.
zfs_vdev_write_gap_limit
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
4096- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
Aggregate write I/O over gap
Notes: To reduce IOPs, small, adjacent I/Os are aggregated (coalesced) into into a large I/O. For writes, aggregations occur across small adjacency gaps where the gap is less than zfs_vdev_write_gap_limit
zfs_vnops_read_chunk_size
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.3 - master
33554432v2.1 - v2.2
1048576- Change:
Dynamic
- Tags:
Bytes to read per chunk
zfs_wrlog_data_max
The size limit of write-transaction zil log data
zfs_xattr_compat
- Versions:
v2.2 - master
- Platforms:
Linux
- Type:
int- Change:
Dynamic
- Tags:
Use legacy ZFS xattr naming for writing new user namespace xattrs
zfs_zevent_cols
- Versions:
v0.6 - v2.0
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
80- Range:
1 to INT_MAX
- Change:
Dynamic
- Tags:
Max event column width
When to change: if 80 columns isn’t enough
Notes: zfs_zevent_cols is a soft wrap limit in columns (characters) for ZFS events logged to the console.
zfs_zevent_console
- Versions:
v0.6 - v2.0
- Platforms:
Linux, FreeBSD
- Type:
int- Range:
0do not log to console
1log to console
- Change:
Dynamic
- Tags:
Log events to the console
When to change: to log ZFS events to the console
Notes: If zfs_zevent_console is true (1), then ZFS events are logged to the console. More logging and log filtering capabilities are provided by zed
zfs_zevent_len_max
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.0 - master
512v0.6 - v0.8
0- Range:
0 to INT_MAX
- Change:
Dynamic
- Tags:
Max event queue length
When to change: increase to see more ZFS events
Notes: zfs_zevent_len_max is the maximum ZFS event queue length. A value of 0 results in a calculated value (16 * number of CPUs) with a minimum of 64. Events in the queue can be viewed with the zpool events command.
zfs_zevent_retain_expire_secs
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
900- Change:
Dynamic
- Tags:
Expiration time for recent zevents records
zfs_zevent_retain_max
- Versions:
v2.0 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
2000- Change:
Dynamic
- Tags:
Maximum recent zevents records to retain for duplicate checking
zfs_zil_clean_taskq_maxalloc
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1048576- Range:
zfs_zil_clean_taskq_minalloc to
INT_MAX- Change:
Dynamic
- Tags:
Max number of taskq entries that are cached
When to change: If more dp_zil_clean_taskq entries are needed to prevent the itxs from being synchronously cleaned
Notes: During a SPA sync, intent log transaction groups (itxg) are cleaned. The cleaning work is dispatched to the DSL pool ZIL clean taskq (dp_zil_clean_taskq). zfs_zil_clean_taskq_minalloc is the minimum and zfs_zil_clean_taskq_maxalloc is the maximum number of cached taskq entries for dp_zil_clean_taskq. The actual number of taskq entries dynamically varies between these values. When zfs_zil_clean_taskq_maxalloc is exceeded transaction records (itxs) are cleaned synchronously with possible negative impact to the performance of SPA sync. Ideally taskq entries are pre-allocated prior to being needed by zil_clean(), thus avoiding dynamic allocation of new taskq entries.
zfs_zil_clean_taskq_minalloc
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1024- Range:
1 to zfs_zil_clean_taskq_maxalloc
- Change:
Dynamic
- Tags:
Number of taskq entries that are pre-populated
Notes: During a SPA sync, intent log transaction groups (itxg) are cleaned. The cleaning work is dispatched to the DSL pool ZIL clean taskq (dp_zil_clean_taskq). zfs_zil_clean_taskq_minalloc is the minimum and zfs_zil_clean_taskq_maxalloc is the maximum number of cached taskq entries for dp_zil_clean_taskq. The actual number of taskq entries dynamically varies between these values. zfs_zil_clean_taskq_minalloc is the minimum number of ZIL transaction records (itxs). Ideally taskq entries are pre-allocated prior to being needed by zil_clean(), thus avoiding dynamic allocation of new taskq entries.
zfs_zil_clean_taskq_nthr_pct
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
100- Range:
1 to 100
- Change:
Dynamic
- Tags:
Max percent of CPUs that are used per dp_sync_taskq
When to change: Testing ZIL clean and SPA sync performance
Notes: zfs_zil_clean_taskq_nthr_pct controls the number of threads used by the DSL pool ZIL clean taskq (dp_zil_clean_taskq). The default value of 100% will create a maximum of one thread per cpu.
zfs_zil_saxattr
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Disable xattr=sa extended attribute logging in ZIL by settng 0.
zil_maxblocksize
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
131072- Change:
Dynamic
- Tags:
Limit in bytes of ZIL log block size
zil_maxcopied
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
7680- Change:
Dynamic
- Tags:
Limit in bytes WR_COPIED size
zil_min_commit_timeout
- Versions:
v2.1
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
5000- Change:
Dynamic
- Tags:
Minimum delay we care for ZIL block commit
zil_nocacheflush
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0send cache flush commands
1do not send cache flush commands
- Change:
Dynamic
- Tags:
Disable ZIL cache flushes
When to change: If the storage device has nonvolatile cache, then disabling cache flush can save the cost of occasional cache flush commands
Notes: ZFS uses barriers (volatile cache flush commands) to ensure data is committed to permanent media by devices. This ensures consistent on-media state for devices where caches are volatile (eg HDDs). zil_nocacheflush disables the cache flush commands that are normally sent to devices by the ZIL after a log write has completed. The difference between zil_nocacheflush and zfs_nocacheflush is zil_nocacheflush applies to ZIL writes while zfs_nocacheflush disables barrier writes to the pool devices at the end of transaction group syncs. WARNING: setting this can cause ZIL corruption on power loss if the device has a volatile write cache.
zil_replay_disable
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0replay ZIL
1destroy ZIL
- Change:
Dynamic
- Tags:
Disable intent logging replay
When to change: Do not change
Notes: If zil_replay_disable = 1, then when a volume or filesystem is brought online, no attempt to replay the ZIL is made and any existing ZIL is destroyed. This can result in loss of data without notice.
zil_slog_bulk
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
u64- Default:
v2.2 - master
67108864v0.7 - v2.1
786,432- Range:
0 to ULONG_MAX
- Change:
Dynamic
- Tags:
Limit in bytes slog sync writes per commit
When to change: See ZFS I/O Scheduler
Notes: zil_slog_bulk is the log device write size limit per commit executed with synchronous priority. Writes below zil_slog_bulk are executed with synchronous priority. Writes above zil_slog_bulk are executed with lower (asynchronous) priority to reduct potential log device abuse by a single active ZIL writer.
zil_slog_limit
- Versions:
v0.6
- Platforms:
Linux, FreeBSD
- Type:
ulong- Default:
1,048,576- Change:
Dynamic
- Tags:
Max commit bytes to separate log device
zil_special_is_slog
- Versions:
v2.4 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Change:
Dynamic
- Tags:
Treat special vdevs as SLOG
zio_deadman_log_all
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0do not log all deadman events
1log all deadman events
- Change:
Dynamic
- Tags:
Log all slow ZIOs, not just those with vdevs
When to change: when debugging ZFS I/O pipeline
Notes: zio_deadman_log_all enables debugging messages for all ZFS I/Os, rather than only for leaf ZFS I/Os for a vdev. This is meant to be used by developers to gain diagnostic information for hang conditions which don’t involve a mutex or other locking primitive. Typically these are conditions where a thread in the zio pipeline is looping indefinitely. See also zfs_dbgmsg_enable
zio_delay_max
- Versions:
v0.6 - v0.7
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
30,000- Range:
1 to INT_MAX
- Change:
Dynamic
- Tags:
Max zio millisec delay before posting event
When to change: when debugging slow I/O
Notes: If a ZFS I/O operation takes more than zio_delay_max milliseconds to complete, then an event is logged. Note that this is only a logging facility, not a timeout on operations. See also zpool events
zio_dva_throttle_enabled
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
1- Range:
0do not throttle ZIO block allocations
1throttle ZIO block allocations
- Change:
Dynamic
- Tags:
Throttle block allocations in the ZIO pipeline
When to change: Testing ZIO block allocation algorithms
Notes: zio_dva_throttle_enabled controls throttling of block allocations in the ZFS I/O (ZIO) pipeline. When enabled, the maximum number of pending allocations per top-level vdev is limited by zfs_vdev_queue_depth_pct (removed after v2.3)
zio_requeue_io_start_cut_in_line
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Range:
0don’t prioritize re-queued I/Os
1prioritize re-queued I/Os
- Change:
Dynamic
- Tags:
Prioritize requeued I/O
When to change: Do not change
Notes: zio_requeue_io_start_cut_in_line controls prioritization of a re-queued ZFS I/O (ZIO) in the ZIO pipeline by the ZIO taskq.
zio_slow_io_ms
- Versions:
v0.8 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
30000- Range:
0 to MAX_INT
- Change:
Dynamic
- Tags:
Max I/O completion time (milliseconds) before marking it as slow
When to change: when debugging slow devices and the default value is inappropriate
Notes: An I/O operation taking more than zio_slow_io_ms milliseconds to complete is marked as a slow I/O. Slow I/O counters can be observed with zpool status -s. Each slow I/O causes a delay zevent, observable using zpool events. See also zfs-events(5).
zio_taskq_batch_pct
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.1 - master
80v0.7 - v2.0
75- Range:
1 to 100, fractional number of CPUs are rounded down
- Change:
Dynamic
- Tags:
SPA, taskq, ZIO, ZIO_scheduler
Percentage of CPUs to run an IO worker thread
When to change: To tune parallelism in multiprocessor systems
Verification: The number of taskqs for each batch group can be observed using ps and counting the threads
Notes: zio_taskq_batch_pct sets the number of I/O worker threads as a percentage of online CPUs. These workers threads are responsible for IO work such as compression and checksum calculations. Each block is handled by one worker thread, so maximum overall worker thread throughput is function of the number of concurrent blocks being processed, the number of worker threads, and the algorithms used. The default is chosen to avoid using all CPUs which can result in latency issues and inconsistent application performance, especially when high compression is enabled. The taskq batch processes are:
zio_taskq_batch_tpq
- Versions:
v2.1 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Change:
Dynamic
- Tags:
Number of threads per IO worker taskqueue
zio_taskq_write_tpq
- Versions:
v2.3 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
16- Change:
Dynamic
- Tags:
Number of CPUs per write issue taskq
zstd_abort_size
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
131072- Change:
Dynamic
- Tags:
Minimal size of block to attempt early abort
zstd_earlyabort_pass
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Change:
Dynamic
- Tags:
Enable early abort attempts when using zstd
zvol_blk_mq_blocks_per_thread
- Versions:
v2.2 - master
- Platforms:
Linux
- Type:
uint- Default:
8- Change:
Dynamic
- Tags:
Process volblocksize blocks per thread
zvol_blk_mq_queue_depth
- Versions:
v2.2 - master
- Platforms:
Linux
- Type:
uint- Default:
0- Change:
Dynamic
- Tags:
Default blk-mq queue depth
zvol_enforce_quotas
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
int- Default:
0- Change:
Dynamic
- Tags:
Enable strict ZVOL quota enforcment
zvol_inhibit_dev
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Range:
0create volume device nodes
1do not create volume device nodes
- Change:
Dynamic
- Tags:
Do not create zvol device nodes
When to change: Inhibiting can slightly improve startup time on systems with a very large number of volumes
Notes: zvol_inhibit_dev controls the creation of volume device nodes upon pool import.
zvol_major
- Versions:
v0.6 - master
- Platforms:
Linux
- Type:
uint- Default:
230- Change:
Prior to module load
- Tags:
Major number for zvol device
When to change: Do not change
zvol_max_discard_blocks
- Versions:
v0.6 - master
- Platforms:
Linux
- Type:
ulong- Default:
16384- Change:
Prior to module load
- Tags:
Max number of blocks to discard
When to change: if volume discard activity severely impacts other workloads
Verification: Observe value of /sys/block/ VOLUME_INSTANCE/queue/discard_max_bytes
Notes: Discard (aka ATA TRIM or SCSI UNMAP) operations done on volumes are done in batches zvol_max_discard_blocks blocks. The block size is determined by the volblocksize property of a volume. Some applications, such as mkfs, discard the whole volume at once using the maximum possible discard size. As a result, many gigabytes of discard requests are not uncommon. Unfortunately, if a large amount of data is already allocated in the volume, ZFS can be quite slow to process discard requests. This is especially true if the volblocksize is small (eg default=8KB). As a result, very large discard requests can take a very long time (perhaps minutes under heavy load) to complete. This can cause a number of problems, most notably if the volume is accessed remotely (eg via iSCSI), in which case the client has a high probability of timing out on the request. Limiting the zvol_max_discard_blocks can decrease the amount of discard workload request by setting the discard_max_bytes and discard_max_hw_bytes for the volume’s block device in SysFS. This value is readable by volume device consumers.
zvol_num_taskqs
- Versions:
v2.2 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Change:
Dynamic
- Tags:
Number of zvol taskqs
zvol_open_timeout_ms
- Versions:
v2.2 - master
- Platforms:
Linux
- Type:
uint- Change:
Dynamic
- Tags:
Timeout for ZVOL open retries
zvol_prefetch_bytes
- Versions:
v0.6 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
131072- Change:
Dynamic
- Tags:
Prefetch N bytes at zvol start+end
Notes: When importing a pool with volumes or adding a volume to a pool, zvol_prefetch_bytes are prefetch from the start and end of the volume. Prefetching these regions of the volume is desirable because they are likely to be accessed immediately by blkid(8) or by the kernel scanning for a partition table.
zvol_request_sync
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
0- Range:
0do concurrent (async) volume requests
1do sync volume requests
- Change:
Dynamic
- Tags:
Synchronously handle bio requests
When to change: Testing concurrent volume requests
Notes: When processing I/O requests for a volume submit them synchronously. This effectively limits the queue depth to 1 for each I/O submitter. When set to 0 requests are handled asynchronously by the “zvol” thread pool. See also zvol_threads
zvol_threads
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
v2.2 - master
0v0.7 - v2.1
32- Range:
0=one thread per active CPU, otherwise 1 to UINT_MAX
- Change:
Dynamic
- Tags:
Number of threads for I/O requests. Set to 0 to use all active CPUs
When to change: Matching the number of concurrent volume requests with workload requirements can improve concurrency
Verification: iostat using avgqu-sz or aqu-sz results
Notes: zvol_threads controls the maximum number of threads handling concurrent volume I/O requests. Since v2.2.0 the default of 0 means one thread per active CPU; before that it was 32, which behaves similarly to a disk with a 32-entry command queue. The actual number of threads required can vary widely by workload and available CPUs. If lock analysis shows high contention in the zvol taskq threads, then reducing the number of zvol_threads or workload queue depth can improve overall throughput. See also zvol_request_sync.
zvol_use_blk_mq
- Versions:
v2.2 - master
- Platforms:
Linux
- Type:
uint- Default:
0- Change:
Dynamic
- Tags:
Use the blk-mq API for zvols
zvol_volmode
- Versions:
v0.7 - master
- Platforms:
Linux, FreeBSD
- Type:
uint- Default:
1- Range:
1full, legacy fully functional behaviour (default)
2dev, hide partitions on volume block devices
3none, not exposing volumes outside ZFS
- Change:
Dynamic
- Tags:
Default volmode property value
Notes: zvol_volmode defines volume block devices behaviour when the volmode property is set to default. To maintain compatibility with ZFS on BSD, “geom” is synonymous with “full”.