Last active
March 25, 2025 07:51
-
-
Save dvanders/968d5862f227e0dd988eb5db8fbba203 to your computer and use it in GitHub Desktop.
ceph-iosched
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# prefer cfq (el7), then mq-deadline (el8), then do nothing | |
if grep -q cfq /sys/block/sd*/queue/scheduler; then | |
# tune SSDs to use noop scheduler and spinning disks to use cfq | |
for DISK in /sys/block/sd*; do grep -q 0 ${DISK}/queue/rotational && echo noop > ${DISK}/queue/scheduler; done | |
for DISK in /sys/block/sd*; do grep -q 1 ${DISK}/queue/rotational && echo cfq > ${DISK}/queue/scheduler; done | |
# tune cfq not to penalize writes when reading heavily | |
find /sys/block/sd*/queue/iosched/group_idle -exec sh -c 'echo 0 > {}' \; | |
find /sys/block/sd*/queue/iosched/slice_idle -exec sh -c 'echo 0 > {}' \; | |
find /sys/block/sd*/queue/iosched/quantum -exec sh -c 'echo 32 > {}' \; | |
exit 0 | |
elif grep -q mq-deadline /sys/block/sd*/queue/scheduler; then | |
# tune SSDs to use none scheduler and spinning disks to use mq-deadline | |
for DISK in /sys/block/sd*; do grep -q 0 ${DISK}/queue/rotational && echo none > ${DISK}/queue/scheduler; done | |
for DISK in /sys/block/sd*; do grep -q 1 ${DISK}/queue/rotational && echo mq-deadline > ${DISK}/queue/scheduler; done | |
# tune mq-deadline not to penalize writes when reading heavily | |
find /sys/block/sd*/queue/iosched/write_expire -exec sh -c 'echo 500 > {}' \; | |
find /sys/block/sd*/queue/iosched/writes_starved -exec sh -c 'echo 1 > {}' \; | |
find /sys/block/sd*/queue/iosched/fifo_batch -exec sh -c 'echo 8 > {}' \; | |
exit 0 | |
else | |
echo Cannot find supported io scheduler. | |
fi |
Still using bfq on all el8 osd servers?:)
yes we are. do you have a better suggestion?
Nope, we chose as well bfq. My question for double check for right choice. Thanks.
Seems cfq
has been gone in kernel 5. (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0e9da3fbf7d81f0f913b491c8de1ba7883d4f217)
Will you use bfq
or mq-deadline
instead?
bfq
Updated -- in 2022 we switched to mq-deadline.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Still using bfq on all el8 osd servers?:)