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 |