简介
降低scrub线程执行优先级,这里设置为最低,从而保障业务线程正常运行。
优化
配置文件
[osd]
osd disk threads = 1
osd disk thread ioprio class = idle
osd disk thread ioprio priority = 7
在线更改
ceph tell osd.* injectargs '--osd_disk_thread_ioprio_priority 7'
ceph tell osd.* injectargs '--osd_disk_thread_ioprio_class idle'
说明:
- osd disk threads
默认为1,scrub(数据一致) 和 snap trim(快照修复)线程数,这里默认就好 - osd disk thread ioprio class
默认为空,idle、be、rt,idle为优先级低于其他线程;be是默认值,优先级等于其他优先级;rt为优先级高于其他线程; - osd disk thread ioprio priority
默认值-1,优先级范围0(highest)-7(lowest),这里设置为7即可; - 第2,3两项同时修改才生效,同时还必须满足如下条件;
条件
scheduler 是 cfq 时以上参数才会生效
# cat /sys/block/sdb/queue/scheduler
noop [deadline] cfq
# echo cfq > /sys/block/sda/queue/scheduler
验证
$ ceph daemon osd.0 config get osd_disk_thread_ioprio_class
{ "osd_disk_thread_ioprio_class": "idle"}
$ ceph daemon osd.0 config get osd_disk_thread_ioprio_priority
{ "osd_disk_thread_ioprio_priority": "7"}
参考
https://ceph.com/geen-categorie/lowering-ceph-scrub-io-priority/