I came across recently, as you do, an option to maximise the performance of my lowly OCZ Core V2 SSD in Ubuntu. Apparently the kernel goes to quite extreme lengths (in terms of using CPU cycles) to avoid doing seeks. With a “standard” hard drive this is desirable because the time it takes the head to move to the correct location is more costly. Seeking is irrelevant as far as an SSD is concerned and using extra CPU time only serves to reduce I/O performance. Happily there is an option to tell the kernel that you are using a non-rotational media for a specific drive designation i.e. sda, sdb, etc. and therefore maximise SSD performance.
echo 0 > /sys/block/sda/queue/rotational
Will tell the kernel via sysfs that the first drive is non-rotational. It is possible to script this elegantly by adding an appropriate udev rule, however, since I don’t plan on changing or moving the drive any time soon I just elected to add it to /etc/rc.local.
A short read only test via Ubuntu’s Disk Utility does reveal a performance increase, but when the system is under heavy I/O load the system has a tendency to hang for a second or two at a time. To alleviate this and make Ubuntu a much snappier beast altogether the best thing to do is to install Con Kolivas’s brilliant BFS scheduler. I won’t tell you what BFS stands for as it’s rude, but Con wrote it because the existing Completely Fair Scheduler isn’t optimised for machines with limited hardware and only a few cores i.e. nearly every desktop machine in use.
To install BFS in Ubuntu run the following commands and reboot:-
sudo add-apt-repository ppa:chogydan/ppa && sudo apt-get update sudo apt-get install linux-ck-image-generic linux-ck-headers-generic
Once rebooted you can confirm you are running the correct kernel by running
which should output
Linux tux 2.6.35-22ck-generic #33~ppa1-Ubuntu SMP Sun Sep 26 22:11:45 UTC 2010 x86_64 GNU/Linux
in 10.10 64 bit.
It’s early days and I have yet to really stress BFS under heavy I/O but the machine is definitely more responsive. I think it is definitely worth trying even if you are using a standard hard disk.