Source string Read only

(itstool) path: sect2/para
120/1200
Context English State
Redundant data is detected and deduplicated:
<prompt>#</prompt> <userinput>zpool list</userinput>
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
pool 2.84G 20.9M 2.82G - - 0% 0% 3.00x ONLINE -
The <literal>DEDUP</literal> column shows a factor of <literal>3.00x</literal>. Multiple copies of the ports tree data was detected and deduplicated, using only a third of the space. The potential for space savings can be enormous, but comes at the cost of having enough memory to keep track of the deduplicated blocks.
Deduplication is not always beneficial, especially when the data on a pool is not redundant. <acronym>ZFS</acronym> can show potential space savings by simulating deduplication on an existing pool:
<prompt>#</prompt> <userinput>zdb -S <replaceable>pool</replaceable></userinput>
Simulated DDT histogram:

bucket allocated referenced
______ ______________________________ ______________________________
refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
------ ------ ----- ----- ----- ------ ----- ----- -----
1 2.58M 289G 264G 264G 2.58M 289G 264G 264G
2 206K 12.6G 10.4G 10.4G 430K 26.4G 21.6G 21.6G
4 37.6K 692M 276M 276M 170K 3.04G 1.26G 1.26G
8 2.18K 45.2M 19.4M 19.4M 20.0K 425M 176M 176M
16 174 2.83M 1.20M 1.20M 3.33K 48.4M 20.4M 20.4M
32 40 2.17M 222K 222K 1.70K 97.2M 9.91M 9.91M
64 9 56K 10.5K 10.5K 865 4.96M 948K 948K
128 2 9.50K 2K 2K 419 2.11M 438K 438K
256 5 61.5K 12K 12K 1.90K 23.0M 4.47M 4.47M
1K 2 1K 1K 1K 2.98K 1.49M 1.49M 1.49M
Total 2.82M 303G 275G 275G 3.20M 319G 287G 287G

dedup = 1.05, compress = 1.11, copies = 1.00, dedup * compress / copies = 1.16
After <command>zdb -S</command> finishes analyzing the pool, it shows the space reduction ratio that would be achieved by activating deduplication. In this case, <literal>1.16</literal> is a very poor space saving ratio that is mostly provided by compression. Activating deduplication on this pool would not save any significant amount of space, and is not worth the amount of memory required to enable deduplication. Using the formula <emphasis>ratio = dedup * compress / copies</emphasis>, system administrators can plan the storage allocation, deciding whether the workload will contain enough duplicate blocks to justify the memory requirements. If the data is reasonably compressible, the space savings may be very good. Enabling compression first is recommended, and compression can also provide greatly increased performance. Only enable deduplication in cases where the additional savings will be considerable and there is sufficient memory for the <link linkend="zfs-term-deduplication"><acronym>DDT</acronym></link>.
<acronym>ZFS</acronym> and Jails
<command>zfs jail</command> and the corresponding <literal>jailed</literal> property are used to delegate a <acronym>ZFS</acronym> dataset to a <link linkend="jails">Jail</link>. <command>zfs jail <replaceable>jailid</replaceable></command> attaches a dataset to the specified jail, and <command>zfs unjail</command> detaches it. For the dataset to be controlled from within a jail, the <literal>jailed</literal> property must be set. Once a dataset is jailed, it can no longer be mounted on the host because it may have mount points that would compromise the security of the host.
Delegated Administration
A comprehensive permission delegation system allows unprivileged users to perform <acronym>ZFS</acronym> administration functions. For example, if each user's home directory is a dataset, users can be given permission to create and destroy snapshots of their home directories. A backup user can be given permission to use replication features. A usage statistics script can be allowed to run with access only to the space utilization data for all users. It is even possible to delegate the ability to delegate permissions. Permission delegation is possible for each subcommand and most properties.
Delegating Dataset Creation
<command>zfs allow <replaceable>someuser</replaceable> create <replaceable>mydataset</replaceable></command> gives the specified user permission to create child datasets under the selected parent dataset. There is a caveat: creating a new dataset involves mounting it. That requires setting the FreeBSD <literal>vfs.usermount</literal> <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> to <literal>1</literal> to allow non-root users to mount a file system. There is another restriction aimed at preventing abuse: non-<systemitem class="username">root</systemitem> users must own the mountpoint where the file system is to be mounted.
Delegating Permission Delegation
<command>zfs allow <replaceable>someuser</replaceable> allow <replaceable>mydataset</replaceable></command> gives the specified user the ability to assign any permission they have on the target dataset, or its children, to other users. If a user has the <literal>snapshot</literal> permission and the <literal>allow</literal> permission, that user can then grant the <literal>snapshot</literal> permission to other users.
Tuning
There are a number of tunables that can be adjusted to make <acronym>ZFS</acronym> perform best for different workloads.
<emphasis><varname>vfs.zfs.arc_max</varname></emphasis> - Maximum size of the <link linkend="zfs-term-arc"><acronym>ARC</acronym></link>. The default is all <acronym>RAM</acronym> but 1 GB, or 5/8 of all <acronym>RAM</acronym>, whichever is more. However, a lower value should be used if the system will be running any other daemons or processes that may require memory. This value can be adjusted at runtime with <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> and can be set in <filename>/boot/loader.conf</filename> or <filename>/etc/sysctl.conf</filename>.
<emphasis><varname>vfs.zfs.arc_meta_limit</varname></emphasis> - Limit the portion of the <link linkend="zfs-term-arc"><acronym>ARC</acronym></link> that can be used to store metadata. The default is one fourth of <varname>vfs.zfs.arc_max</varname>. Increasing this value will improve performance if the workload involves operations on a large number of files and directories, or frequent metadata operations, at the cost of less file data fitting in the <link linkend="zfs-term-arc"><acronym>ARC</acronym></link>. This value can be adjusted at runtime with <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> and can be set in <filename>/boot/loader.conf</filename> or <filename>/etc/sysctl.conf</filename>.
<emphasis><varname>vfs.zfs.arc_min</varname></emphasis> - Minimum size of the <link linkend="zfs-term-arc"><acronym>ARC</acronym></link>. The default is one half of <varname>vfs.zfs.arc_meta_limit</varname>. Adjust this value to prevent other applications from pressuring out the entire <link linkend="zfs-term-arc"><acronym>ARC</acronym></link>. This value can be adjusted at runtime with <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> and can be set in <filename>/boot/loader.conf</filename> or <filename>/etc/sysctl.conf</filename>.
<emphasis><varname>vfs.zfs.vdev.cache.size</varname></emphasis> - A preallocated amount of memory reserved as a cache for each device in the pool. The total amount of memory used will be this value multiplied by the number of devices. This value can only be adjusted at boot time, and is set in <filename>/boot/loader.conf</filename>.
<emphasis><varname>vfs.zfs.min_auto_ashift</varname></emphasis> - Minimum <varname>ashift</varname> (sector size) that will be used automatically at pool creation time. The value is a power of two. The default value of <literal>9</literal> represents <literal>2^9 = 512</literal>, a sector size of 512 bytes. To avoid <emphasis>write amplification</emphasis> and get the best performance, set this value to the largest sector size used by a device in the pool.
Many drives have 4 KB sectors. Using the default <varname>ashift</varname> of <literal>9</literal> with these drives results in write amplification on these devices. Data that could be contained in a single 4 KB write must instead be written in eight 512-byte writes. <acronym>ZFS</acronym> tries to read the native sector size from all devices when creating a pool, but many drives with 4 KB sectors report that their sectors are 512 bytes for compatibility. Setting <varname>vfs.zfs.min_auto_ashift</varname> to <literal>12</literal> (<literal>2^12 = 4096</literal>) before creating a pool forces <acronym>ZFS</acronym> to use 4 KB blocks for best performance on these drives.
Forcing 4 KB blocks is also useful on pools where disk upgrades are planned. Future disks are likely to use 4 KB sectors, and <varname>ashift</varname> values cannot be changed after a pool is created.
In some specific cases, the smaller 512-byte block size might be preferable. When used with 512-byte disks for databases, or as storage for virtual machines, less data is transferred during small random reads. This can provide better performance, especially when using a smaller <acronym>ZFS</acronym> record size.
<emphasis><varname>vfs.zfs.prefetch_disable</varname></emphasis> - Disable prefetch. A value of <literal>0</literal> is enabled and <literal>1</literal> is disabled. The default is <literal>0</literal>, unless the system has less than 4 GB of <acronym>RAM</acronym>. Prefetch works by reading larger blocks than were requested into the <link linkend="zfs-term-arc"><acronym>ARC</acronym></link> in hopes that the data will be needed soon. If the workload has a large number of random reads, disabling prefetch may actually improve performance by reducing unnecessary reads. This value can be adjusted at any time with <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
<emphasis><varname>vfs.zfs.vdev.trim_on_init</varname></emphasis> - Control whether new devices added to the pool have the <literal>TRIM</literal> command run on them. This ensures the best performance and longevity for <acronym>SSD</acronym>s, but takes extra time. If the device has already been secure erased, disabling this setting will make the addition of the new device faster. This value can be adjusted at any time with <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
<emphasis><varname>vfs.zfs.vdev.max_pending</varname></emphasis> - Limit the number of pending I/O requests per device. A higher value will keep the device command queue full and may give higher throughput. A lower value will reduce latency. This value can be adjusted at any time with <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
<emphasis><varname>vfs.zfs.top_maxinflight</varname></emphasis> - Maxmimum number of outstanding I/Os per top-level <link linkend="zfs-term-vdev">vdev</link>. Limits the depth of the command queue to prevent high latency. The limit is per top-level vdev, meaning the limit applies to each <link linkend="zfs-term-vdev-mirror">mirror</link>, <link linkend="zfs-term-vdev-raidz">RAID-Z</link>, or other vdev independently. This value can be adjusted at any time with <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
<emphasis><varname>vfs.zfs.l2arc_write_max</varname></emphasis> - Limit the amount of data written to the <link linkend="zfs-term-l2arc"><acronym>L2ARC</acronym></link> per second. This tunable is designed to extend the longevity of <acronym>SSD</acronym>s by limiting the amount of data written to the device. This value can be adjusted at any time with <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
<emphasis><varname>vfs.zfs.l2arc_write_boost</varname></emphasis> - The value of this tunable is added to <link linkend="zfs-advanced-tuning-l2arc_write_max"><varname>vfs.zfs.l2arc_write_max</varname></link> and increases the write speed to the <acronym>SSD</acronym> until the first block is evicted from the <link linkend="zfs-term-l2arc"><acronym>L2ARC</acronym></link>. This <quote>Turbo Warmup Phase</quote> is designed to reduce the performance loss from an empty <link linkend="zfs-term-l2arc"><acronym>L2ARC</acronym></link> after a reboot. This value can be adjusted at any time with <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
<emphasis><varname>vfs.zfs.scrub_delay</varname></emphasis> - Number of ticks to delay between each I/O during a <link linkend="zfs-term-scrub"><command>scrub</command></link>. To ensure that a <command>scrub</command> does not interfere with the normal operation of the pool, if any other <acronym>I/O</acronym> is happening the <command>scrub</command> will delay between each command. This value controls the limit on the total <acronym>IOPS</acronym> (I/Os Per Second) generated by the <command>scrub</command>. The granularity of the setting is determined by the value of <varname>kern.hz</varname> which defaults to 1000 ticks per second. This setting may be changed, resulting in a different effective <acronym>IOPS</acronym> limit. The default value is <literal>4</literal>, resulting in a limit of: 1000 ticks/sec / 4 = 250 <acronym>IOPS</acronym>. Using a value of <replaceable>20</replaceable> would give a limit of: 1000 ticks/sec / 20 = 50 <acronym>IOPS</acronym>. The speed of <command>scrub</command> is only limited when there has been recent activity on the pool, as determined by <link linkend="zfs-advanced-tuning-scan_idle"><varname>vfs.zfs.scan_idle</varname></link>. This value can be adjusted at any time with <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>.

Loading…

No matching activity found.

Browse all component changes

Glossary

English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect2/para
Flags
read-only
Source string location
book.translate.xml:42496
String age
a year ago
Source string age
a year ago
Translation file
books/handbook.pot, string 6972