mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
9f500936c8
The existing algorithm selects a preferred leaf vdev based on offset of the zio
request modulo the number of members in the mirror. It assumes the devices are
of equal performance and that spreading the requests randomly over both drives
will be sufficient to saturate them. In practice this results in the leaf vdevs
being under utilized.
The new algorithm takes into the following additional factors:
* Load of the vdevs (number outstanding I/O requests)
* The locality of last queued I/O vs the new I/O request.
Within the locality calculation additional knowledge about the underlying vdev
is considered such as; is the device backing the vdev a rotating media device.
This results in performance increases across the board as well as significant
increases for predominantly streaming loads and for configurations which don't
have evenly performing devices.
The following are results from a setup with 3 Way Mirror with 2 x HD's and
1 x SSD from a basic test running multiple parrallel dd's.
With pre-fetch disabled (vfs.zfs.prefetch_disable=1):
== Stripe Balanced (default) ==
Read 15360MB using bs: 1048576, readers: 3, took 161 seconds @ 95 MB/s
== Load Balanced (zfslinux) ==
Read 15360MB using bs: 1048576, readers: 3, took 297 seconds @ 51 MB/s
== Load Balanced (locality freebsd) ==
Read 15360MB using bs: 1048576, readers: 3, took 54 seconds @ 284 MB/s
With pre-fetch enabled (vfs.zfs.prefetch_disable=0):
== Stripe Balanced (default) ==
Read 15360MB using bs: 1048576, readers: 3, took 91 seconds @ 168 MB/s
== Load Balanced (zfslinux) ==
Read 15360MB using bs: 1048576, readers: 3, took 108 seconds @ 142 MB/s
== Load Balanced (locality freebsd) ==
Read 15360MB using bs: 1048576, readers: 3, took 48 seconds @ 320 MB/s
In addition to the performance changes the code was also restructured, with
the help of Justin Gibbs, to provide a more logical flow which also ensures
vdevs loads are only calculated from the set of valid candidates.
The following additional sysctls where added to allow the administrator
to tune the behaviour of the load algorithm:
* vfs.zfs.vdev.mirror.rotating_inc
* vfs.zfs.vdev.mirror.rotating_seek_inc
* vfs.zfs.vdev.mirror.rotating_seek_offset
* vfs.zfs.vdev.mirror.non_rotating_inc
* vfs.zfs.vdev.mirror.non_rotating_seek_inc
These changes where based on work started by the zfsonlinux developers:
https://github.com/zfsonlinux/zfs/pull/1487
Reviewed by: gibbs, mav, will
MFC after: 2 weeks
Sponsored by: Multiplay
References:
https://github.com/freebsd/freebsd@5c7a6f5d
https://github.com/freebsd/freebsd@31b7f68d
https://github.com/freebsd/freebsd@e186f564
Performance Testing:
https://github.com/zfsonlinux/zfs/pull/4334#issuecomment-189057141
Porting notes:
- The tunables were adjusted to have ZoL-style names.
- The code was modified to use ZoL's vd_nonrot.
- Fixes were done to make cstyle.pl happy
- Merge conflicts were handled manually
- freebsd/freebsd@e186f564bc by my
collegue Andriy Gapon has been included. It applied perfectly, but
added a cstyle regression.
- This replaces
|
||
---|---|---|
.. | ||
fm | ||
fs | ||
arc_impl.h | ||
arc.h | ||
avl_impl.h | ||
avl.h | ||
blkptr.h | ||
bplist.h | ||
bpobj.h | ||
bptree.h | ||
bqueue.h | ||
dbuf.h | ||
ddt.h | ||
dmu_impl.h | ||
dmu_objset.h | ||
dmu_send.h | ||
dmu_traverse.h | ||
dmu_tx.h | ||
dmu_zfetch.h | ||
dmu.h | ||
dnode.h | ||
dsl_bookmark.h | ||
dsl_dataset.h | ||
dsl_deadlist.h | ||
dsl_deleg.h | ||
dsl_destroy.h | ||
dsl_dir.h | ||
dsl_pool.h | ||
dsl_prop.h | ||
dsl_scan.h | ||
dsl_synctask.h | ||
dsl_userhold.h | ||
efi_partition.h | ||
Makefile.am | ||
metaslab_impl.h | ||
metaslab.h | ||
mntent.h | ||
multilist.h | ||
nvpair_impl.h | ||
nvpair.h | ||
range_tree.h | ||
refcount.h | ||
rrwlock.h | ||
sa_impl.h | ||
sa.h | ||
sdt.h | ||
spa_boot.h | ||
spa_impl.h | ||
spa.h | ||
space_map.h | ||
space_reftree.h | ||
trace_acl.h | ||
trace_arc.h | ||
trace_dbgmsg.h | ||
trace_dbuf.h | ||
trace_dmu.h | ||
trace_dnode.h | ||
trace_multilist.h | ||
trace_txg.h | ||
trace_zil.h | ||
trace_zrlock.h | ||
trace.h | ||
txg_impl.h | ||
txg.h | ||
u8_textprep_data.h | ||
u8_textprep.h | ||
uberblock_impl.h | ||
uberblock.h | ||
uio_impl.h | ||
unique.h | ||
uuid.h | ||
vdev_disk.h | ||
vdev_file.h | ||
vdev_impl.h | ||
vdev.h | ||
xvattr.h | ||
zap_impl.h | ||
zap_leaf.h | ||
zap.h | ||
zfeature.h | ||
zfs_acl.h | ||
zfs_context.h | ||
zfs_ctldir.h | ||
zfs_debug.h | ||
zfs_delay.h | ||
zfs_dir.h | ||
zfs_fuid.h | ||
zfs_ioctl.h | ||
zfs_onexit.h | ||
zfs_rlock.h | ||
zfs_sa.h | ||
zfs_stat.h | ||
zfs_vfsops.h | ||
zfs_vnops.h | ||
zfs_znode.h | ||
zil_impl.h | ||
zil.h | ||
zio_checksum.h | ||
zio_compress.h | ||
zio_impl.h | ||
zio_priority.h | ||
zio.h | ||
zpl.h | ||
zrlock.h | ||
zvol.h |