PDA

View Full Version : More on setting up SSDs.



dd_wizard
29th March 2016, 07:39 PM
After following Stevea's guide, I noticed that adding elevator=noop to the grub command line causes all drives to use that scheduler. After some googling, I found this post (http://bernaerts.dyndns.org/linux/74-ubuntu/250-ubuntu-tweaks-ssd). To summarize, this author recommends deadline over noop.
The first one noop is basically no scheduler at all, it's a basic FIFO (First In, First Out) queue. In comparison, deadline does some sorting to guarantee read requests take priority over write, which is useful if you want to guarantee read responsiveness under heavy writes.
He also includes a pair of udev rules that will make sure attached drives will get the correct scheduler no matter what parameter is passed on the grub command line.


Create the file /etc/udev/rules.d/60-schedulers.rules containing the following:

# Handle the scheduler choice according to the type of disk detected

# system default : set cfq scheduler for rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"

# SSD specific : set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"

These rules work on F23 without resorting to a systemd unit or rc.local:


$ cat /sys/block/sd[ab]/queue/scheduler
noop [deadline] cfq
noop deadline [cfq]


Also, I changed the line /etc/systemd/journald.conf to Storage=volatile to reduce writing to the SSD.

dd_wizard

lsatenstein
29th March 2016, 11:55 PM
After following Stevea's guide, I noticed that adding elevator=noop to the grub command line causes all drives to use that scheduler. After some googling, I found this post (http://bernaerts.dyndns.org/linux/74-ubuntu/250-ubuntu-tweaks-ssd). To summarize, this author recommends deadline over noop.
He also includes a pair of udev rules that will make sure attached drives will get the correct scheduler no matter what parameter is passed on the grub command line.


Create the file /etc/udev/rules.d/60-schedulers.rules containing the following:

# Handle the scheduler choice according to the type of disk detected

# system default : set cfq scheduler for rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"

# SSD specific : set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"

These rules work on F23 without resorting to a systemd unit or rc.local:


$ cat /sys/block/sd[ab]/queue/scheduler
noop [deadline] cfq
noop deadline [cfq]


Also, I changed the line /etc/systemd/journald.conf to Storage=volatile to reduce writing to the SSD.

dd_wizard

Hi dd
for the second entry with ...sd[ab]... is that for /sdb = SSD, and the other, a spinning disk?

My SSD is at /dev/sde

dd_wizard
30th March 2016, 12:50 AM
The first entry, sda, is the SSD. The second entry, sdb, is the rotating HD. The command line just catted the files in the sda, then the sdb sub-directories. This command clarifies the results:


$ grep . /sys/block/sd[ab]/queue/scheduler
/sys/block/sda/queue/scheduler:noop [deadline] cfq
/sys/block/sdb/queue/scheduler:noop deadline [cfq]

dd_wizard