dm-queue-length¶
dm-queue-length 是一个用于设备映射器目标(device-mapper targets)的路径选择器模块,它选择飞行中 I/O 数量最少的路径。此路径选择器的名称是“queue-length”。
每个路径的表参数:[<repeat_count>]
<repeat_count>: The number of I/Os to dispatch using the selected
path before switching to the next path.
If not given, internal default is used. To check
the default value, see the activated table.
每个路径的状态:<status> <fail-count> <in-flight>
<status>: 'A' if the path is active, 'F' if the path is failed.
<fail-count>: The number of path failures.
<in-flight>: The number of in-flight I/Os on the path.
算法¶
dm-queue-length 在 I/O 分派/完成时分别增加/减少“in-flight”计数。dm-queue-length 选择“in-flight”计数最小的路径。
示例¶
当使用两条路径(sda 和 sdb)且 repeat_count == 128 时。
# echo "0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128" \
dmsetup create test
#
# dmsetup table
test: 0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128
#
# dmsetup status
test: 0 10 multipath 2 0 0 0 1 1 E 0 2 1 8:0 A 0 0 8:16 A 0 0