Setting I/O Bandwidth Limits

Setting the size of a ZFS dataset can ensure an appropriate allocation of space in a configuration that contains multiple volumes to service different ZFS clients. However, ZFS clients of a specific dataset can still monopolize the system's bandwidth if the I/O operations within the dataset surpasses those operations in other datasets. Monopoly of bandwidth use effectively denies other ZFS clients of other datasets from accessing the data. By using the read and write limiting properties, you can assign limits to the I/O operations in datasets to provide bandwidth to all datasets for their respective clients to use.

  • writelimit – Sets the maximum bytes per second that a dataset can write to disk

  • readlimit – Sets the maximum bytes per second that a dataset can read from a disk

  • defaultwritelimit – Sets the maximum bytes per second that the descendants of a dataset can write to disk

  • defaultreadlimit – Sets the maximum bytes per second that the descendants of a dataset can read from a disk

  • effectivewritelimit – Reports the maximum bytes per second that a dataset can write to disk

  • effectivereadlimit – Reports the maximum bytes per second that a dataset can read from a disk

Note:

These values are not guaranteed bandwidth and the actual bandwidth may be limited by other factors including usage and limits set on other datasets in the hierarchy. Enforcement of these limits may be delayed by several seconds.

The default limits on the descendants of a dataset can be overwritten with the writelimit or readlimit properties. They can be set to any value, but the throughput on a descendant dataset will not be more than the rate of a parent dataset. The minimum value for these properties is 500K.

$ zfs get -r writelimit,defaultwritelimit,effectivewritelimit users/home
NAME                  PROPERTY              VALUE     SOURCE
users/home            writelimit            default   default
users/home            defaultwritelimit     none      default
users/home            effectivewritelimit   none      local
users/home/kaydo      writelimit            default   default
users/home/kaydo      defaultwritelimit     none      default
users/home/kaydo      effectivewritelimit   none      local

The writelimit or readlimit properties can be set to none to inherit the limit set on the parent dataset. Also they can be set to default to use the default limit set on the parent dataset.

Example 7-5 Default Settings for Bandwidth Limiting Properties

If a new dataset is created, it uses the bandwidth limits established by the parent dataset. In this example, the parent dataset had no bandwidth limiting properties set.

$ zfs get -r writelimit,defaultwritelimit,effectivewritelimit users/home
NAME                 PROPERTY              VALUE     SOURCE
users/home           writelimit            default   default
users/home           defaultwritelimit     none      default
users/home           effectivewritelimit   none      local
users/home/nneke     writelimit            default   default
users/home/nneke     defaultwritelimit     none      default
users/home/nneke     effectivewritelimit   none      local

In this example. the parents' defaultwritelimit properties was set to 500K, so that is the effective write limit for the descendant dataset.

$ zfs get -r writelimit,defaultwritelimit,effectivewritelimit users/home
NAME                 PROPERTY              VALUE     SOURCE
users/home           writelimit            1M        local
users/home           defaultwritelimit     500K      local
users/home           effectivewritelimit   1M        local
users/home/nneke     writelimit            default   default
users/home/nneke     defaultwritelimit     500K      inherited from users/home
users/home/nneke     effectivewritelimit   500K      local

Example 7-6 Using the Bandwidth Limiting Properties From the Parent Dataset

By default, descendant datasets use the bandwidth limiting values set in the parents' defaultwritelimit and defaultreadlimit properties. If you want to use the same write values as the parent dataset instead of the default settings, set the writelimit property for the descendant dataset to none. In this case, the effective write limit will be reported as the same as the parent datasets' writelimit property. In this example the effective write limit for the descendant dataset is 1M which is the effective write limit of the parent, instead of 500K which is the default write limit set in the parent dataset.

$ zfs set writelimit=none users/home/kaydo
$ zfs get -r writelimit,defaultwritelimit,effectivewritelimit users/home
NAME                  PROPERTY              VALUE    SOURCE
users/home            writelimit            1M       local
users/home            defaultwritelimit     500K     local
users/home            effectivewritelimit   1M       local
users/home/kaydo      writelimit            none     local
users/home/kaydo      defaultwritelimit     500K     inherited from users/home
users/home/kaydo      effectivewritelimit   1M       local

In this example, the descendants' properties are limited by the write limit set by on the parent dataset. The descendant dataset will not be given higher bandwidth values than the parent.

$ zfs create -o writelimit=2M users/home/mork
$ zfs get -r writelimit,defaultwritelimit,effectivewritelimit users/home
NAME                 PROPERTY              VALUE    SOURCE
users/home           writelimit            1M       local
users/home           defaultwritelimit     500K     local
users/home           effectivewritelimit   1M       local
users/home/mork      writelimit            2M       local
users/home/mork      defaultwritelimit     500K     inherited from users/home
users/home/mork      effectivewritelimit   1M       local