zpool performance optimal property vdev's ashift or sector at create time

理解ZFS的ashift参数及其优化选择
本文深入探讨了ZFS文件系统的ashift参数,解释了它如何影响扇区大小设置,并提供了如何根据底层设备的sector大小来优化Zpool创建的建议。通过实例演示了如何在创建Zpool时指定合适的ashift值以实现性能与空间的平衡。
只能在创建zpool时指定的唯一参数ashift, 用于指定zpool的扇区大小(2^ashift bytes).
比较优化的选择是大于等于底层设备的sector.
查看块设备的sector. 例如
fdisk -l /dev/sdb
看到如下一行.
Sector size (logical/physical): 512 bytes / 512 bytes

但是有些系统可能将4K的sector认为是512字节的, 所以如果要强制使用4K sector的话, 建议在创建zpool时指定ashift=12.
例如 : 
# zpool create -o ashift=12 zp1 raidz2 sdb sdc sdd sde sdf sdg sdh sdi sdj sdk spare sdl sdm

[参考]
1. man zpool
       ashift

           Pool  sector  size exponent, to the power of 2 (internally referred to as "ashift"). I/O operations will be
           aligned to the specified size boundaries. Additionally, the minimum (disk) write size will be  set  to  the
           specified  size,  so  this  represents a space vs. performance trade-off. The typical case for setting this
           property is when performance is important and the underlying disks use 4KiB sectors but report 512B sectors
           to the OS (for compatibility reasons); in that case, set ashift=12 (which is 1<<12 = 4096).

           For  optimal  performance,  the  pool sector size should be greater than or equal to the sector size of the
           underlying disks. Since the property cannot be changed after pool creation, if in a given  pool,  you  ever
           want to use drives that report 4KiB sectors, you must set ashift=12 at pool creation time.

           Keep in mind is that the ashift is vdev specific and is not a pool global.  This means that when adding new
           vdevs to an existing pool you may need to specify the ashift.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值