Last active
August 29, 2015 13:56
-
-
Save frace/8906634 to your computer and use it in GitHub Desktop.
A "collection" of approaches to set the io scheduler for ssds on systems where both ssds and hdds are used.
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
| # An openrc init script (local.d) which sets the io scheduler in "/sys/block/sd?/queue/scheduler" | |
| # for a custom list of known solid state drives. | |
| enable=false | |
| local_start() | |
| { | |
| local ssd_scheduler | |
| local -a ssd_devices | |
| ssd_scheduler="deadline" | |
| ssd_devices=( | |
| "sda" | |
| "sdb" | |
| ) | |
| for ssd in "${ssd_devices[@]}"; do | |
| if [[ -e "/dev/${ssd}" ]]; then | |
| echo "$ssd_scheduler" > "/sys/block/${ssd}/queue/scheduler" | |
| fi | |
| done | |
| return 0 | |
| } | |
| if $enable; then | |
| local_start | |
| fi |
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
| # An udev rule which sets the io scheduler for ssds based on "/sys/block/sd?/queue/rotational" | |
| # in "/sys/block/sd?/queue/scheduler" automatically. | |
| # https://wiki.debian.org/SSDOptimization#Low-Latency_IO-Scheduler | |
| ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment