By default Ubuntu uses the CFQ I/O scheduler which is great for hard disks.
CFG does smart choices which makes I/O faster for mechanical platter hard disks, but these smart choices while faster for mechanical disks are slower for SSD.
Other schedulers are noop and deadline.
I have an Intel X-25M G2 80 gb SSD.
I did some benchmarks between the I/O schedulers using hdparm. I ran the tests three times for higher accuracy.
sudo hdparm -t /dev/sda for timed buffered disk reads
sudo hdparm -T /dev/sda for timed cache reads
So if you are using an SSD (or atleast if you're using the Intel X-25M G2) then you should be using either the NOOP or DEADLINE I/O schedulers instead of the default CFQ.----------- cfq
Timing buffered disk reads: 630 MB in 3.00 seconds = 209.73 MB/sec
Timing buffered disk reads: 634 MB in 3.01 seconds = 210.56 MB/sec
Timing buffered disk reads: 632 MB in 3.00 seconds = 210.64 MB/sec
Timing cached reads: 6450 MB in 2.00 seconds = 3230.38 MB/sec
Timing cached reads: 6274 MB in 2.00 seconds = 3141.61 MB/sec
Timing cached reads: 6534 MB in 2.00 seconds = 3272.91 MB/sec
----------- deadline
Timing buffered disk reads: 636 MB in 3.01 seconds = 211.22 MB/sec
Timing buffered disk reads: 634 MB in 3.00 seconds = 211.31 MB/sec
Timing buffered disk reads: 638 MB in 3.00 seconds = 212.34 MB/sec
Timing cached reads: 8386 MB in 2.00 seconds = 4200.94 MB/sec
Timing cached reads: 8396 MB in 2.00 seconds = 4205.29 MB/sec
Timing cached reads: 7900 MB in 2.00 seconds = 3956.45 MB/sec
------------ noop
Timing buffered disk reads: 600 MB in 3.00 seconds = 199.96 MB/sec
Timing buffered disk reads: 646 MB in 3.00 seconds = 215.02 MB/sec
Timing buffered disk reads: 646 MB in 3.00 seconds = 215.00 MB/sec
Timing cached reads: 7768 MB in 2.00 seconds = 3890.27 MB/sec
Timing cached reads: 7618 MB in 2.00 seconds = 3815.35 MB/sec
Timing cached reads: 7932 MB in 2.00 seconds = 3973.19 MB/sec
To see what I/O scheduler is currently in use:
$ cat /sys/block/sda/queue/scheduler
If using an SSD, then don't forget to add 'noatime' in /etc/fstab for all your partitions on the SSD. This to save the limited write cycles on the disk.
To switch the I/O scheduler to noop or deadline:
$ sudo gedit /etc/default/grub
Look for GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
Change to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=noop"
$ sudo update-grub
Note, this will make Linux use the noop scheduler for ALL disks in the system, including any mechanical disks.
Deadline and noop are better for SSD.
CFQ is better for HDD.



Adv Reply




Bookmarks