1
Posted on 5/18/2009 10:11:00 am by Nicolas and filed under , , , ,

For a while now, I've been searching documentation about Solid State Drives (SSD). They are still quite expensive when compared to traditional SATA drives - 40 times more expensive in fact :), but they offer good performances and as their prices will keep falling down, they will make a better alternative. Among other advantages, they are shock-resistant, consume less resources than traditional HD and have very fast access times.
My X300 is currently fitted with a 64GB Samsung SSD that works fine with either Fedora or Ubuntu. That said, the performance and life expectency of an SSD drive can be significantly improved by a few tweaks.

1. Mount volumes using the noatime option
By default on Linux, the last accessed time of files will be logged. All these additional write operations can reduce the life of the disk. The noatime mount option will turn this off. Most Linux distros use the relatime option by default. For your SSD partitions (presumably formatted as ext3), replace relatime with noatime in /etc/fstab.
PS: you need a reboot for these changes to take effect.

2. Change the I/O scheduler
The default I/O scheduler in Linux is cfq, which stands for "completely fair queuing". It works quite well with standard HD but since SSDs are a different sort of beast, noop or deadline are probably more suited to them.
Personally, I've opted for noop. Simply added “elevator=noop” to the kernel parameters in my boot loader’s config file - typically /boot/grub/menu.lst. Here is the Fedora section on my laptop:
title Fedora Core 10
root (hd0,0)
kernel /vmlinuz-2.6.27.21-170.2.56.fc10.x86_64 ro rhgb quiet elevator=noop
initrd /initrd-2.6.27.21-170.2.56.fc10.x86_64.img
quiet

Once again, this type of change need a restart to be fully effective.

3. Prefer ramdisk for temporary filesystems
This is something I've been using for a while, even with standard HD, for machines where the amount of available RAM is important. For standard HD, the reasoning was that reading the RAM was faster than reading the disk. With SSD, this performance argument can be discussed, but still, you will increase your disk's life expectancy by moving temporary filesystems that are frequently read to the RAM. Another advantage is that these filesystems are removed then re-mounted at every reboot, meaning that you are less likely to have to clean them up manually.
Again, the changes are to be made in /etc/fstab. Here is a sample from my Ubuntu fstab:
$ grep tmpfs /etc/fstab
tmpfs /tmp tmpfs defaults,noatime,mode=1777,size=1024M 0 0
tmpfs /var/tmp tmpfs defaults,noatime,mode=1777,size=512M 0 0

Limiting the size of these tmpfs directly in /etc/fstab is likely a bit of an overkill, but these temporary filesystems (especially /tmp) can be filled up pretty quickly (by an application core dump for instance) and you surely don't want to see all your RAM eaten up in such case...

Post a Comment