2008年8月19日

A Tweaker’s Guide to Solid State Drives (SSDs)

Geek Sheet: A Tweaker’s Guide to Solid State Drives (SSDs) and Linux | Tech Broiler | ZDNet.com
Tweak #1: If your system motherboard uses a disk caching bus, change the BIOS setting from “Write Through” to “Write Back”.
[root@techbroiler ~]# hdparm -W0 /dev/sda

Tweak #2: Use the “noop” I/O scheduler. By default, Linux uses an “elevator” so that platter reads and writes are done in an orderly and sequential matter.
By adding elevator=noop to your kernel boot parameters in your /boot/grub/menu.lst file, you will greatly improve read and write performance on your SSD.
This parameter sets the default I/O scheduler system wide, so if you have mixed SSD and conventional disks in your computer, you will want to set the scheduler on a drive-by-drive basis. This can be achieved using the following command:
echo noop > /sys/block/sda/queue/scheduler

Tweak #3: Change the file system mount options on SSDs to “noatime”.

Tweak #4: Ditch the journal and RAID your SSDs. File system journaling is done primarily for increased reliability, but it’s a drag on performance. Given that SSDs by their nature are going to be less prone to reliability quirks than a conventional drive, Mandrake suggests creating a RAID1 of two SSD units and formatting the file system to ext2, or formatting them to ext3 and mounting them as ext2 in the /etc/fstab. Dump your MySQL database on a RAID of ext2 SSDs, and you’ll be in performance hog heaven. EDIT 07-27-08: Some concerns were raised about what could happen if the power goes out and you lose referential integrity of the FS and are unable to replay it from the journal — so you might want to use a traditional disk using a journaled FS to sync the database to for backups.


ref:
Choosing an I/O Scheduler for Red Hat® Enterprise Linux® 4 and the 2.6 Kernel

沒有留言: