User Tools

Site Tools


howtos:i_o_scheduler_algorithm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

howtos:i_o_scheduler_algorithm [d/m/Y H:i]
howtos:i_o_scheduler_algorithm [d/m/Y H:i] (current)
Line 1: Line 1:
 +The I/O scheduler in Linux doesn't favour SSD disks so this little trick should keep a more fluent feeling on the desktop.
 +
 +This hack can be utilized as either a grub setting or through a rc.local script.
 +
 +**__Pre Grub 2:__**
 +
 +To set the scheduler in grub append this to the kernel parameters. Find the line looking like this:
 +
 +<file>
 +linux /vmlinuz-2.6.31-14-generic root=/dev/mapper/myhostname-root ro quiet splash
 +</file>
 +
 +and append this:
 +
 +<file>
 +linux /vmlinuz-2.6.31-14-generic root=/dev/mapper/myhostname-root ro quiet splash elevator=deadline
 +</file>
 +
 +**__Grub 2:__**
 +
 +Edit the file /etc/default/grub and find this line:
 +
 +<file>
 +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
 +</file>
 +
 +change it to this:
 +
 +<file>
 +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=deadline"
 +</file>
 +
 +and run:
 +
 +<code>
 +# update-grub
 +Generating grub.cfg ...
 +Found linux image: /boot/vmlinuz-2.6.31-14-generic
 +Found initrd image: /boot/initrd.img-2.6.31-14-generic
 +Found memtest86+ image: /memtest86+.bin
 +Done
 +</code>
 +
 +You can also make the changes in the rc.local script:
 +
 +<file>
 +#!/bin/sh -e
 +#
 +# rc.local
 +#
 +# This script is executed at the end of each multiuser runlevel.
 +# Make sure that the script will "exit 0" on success or any other
 +# value on error.
 +#
 +# In order to enable or disable this script just change the execution
 +# bits.
 +#
 +# By default this script does nothing.
 +
 +echo deadline > /sys/block/sda/queue/scheduler
 +echo deadline > /sys/block/sdb/queue/scheduler
 +echo deadline > /sys/block/sdc/queue/scheduler
 +echo 1 > /sys/block/sda/queue/iosched/fifo_batch
 +echo 1 > /sys/block/sdb/queue/iosched/fifo_batch
 +echo 1 > /sys/block/sdc/queue/iosched/fifo_batch
 +
 +exit 0
 +</file>
 + The scheduler is per disk, that's why there is a statement per device (/dev/sdX).
 +
  
howtos/i_o_scheduler_algorithm.txt · Last modified: d/m/Y H:i (external edit)