The risks of Solid-State Drives

Submitted by admin on Sun, 04/15/2012 - 15:08

Almost exactly a year ago, I bought a snappy little 60G SSD drive for my home server for only around $100 or so.  I have been very pleased with its performance; for example, I can boot the server in only about ten seconds!  Ironically enough, though, I keep this system running 24x7, and therefore rarely experienced this particular benefit.

Yesterday, I was unfortunate enough to have to deal with the darker side of SSD use: early drive failure.  My problems stemmed from a cron job I wrote last weekend to improve the backup process I was using for my Drupal sites. The scriptran every four hours to check and see if anyone had added a page, added a user or changed a permission setting, and if any of those things had occurred, it dumped the database and rsync'ed it to the HD on my local computer.  The problem was that the script continued to test the backup by re-importing the SQL dump into a local database, so that we could see the backed-up site on the local system for verification purposes.  I ran out of time just before writing a bit of code to check to see if the mod date on the SQL dump had actually changed before running the re-import (only a couple of minutes of work!); the script was re-importing the database once every four hours whether it changed or not. It only took a short while to do all four, so I didn't think it was a problem, and figured I'd put in the optimization to skip the import soon.  Unfortunately, although the SQL dump was on the HD, the database itself was on the SSD.  Four imports, repeated every four hours killed the disk in only one week.

The moral of this story is that you should not keep active SQL databases, or any other item that might thrash the disk on an SSD.  If you are running a system that has both an SSD and an HD, you might consider the following items as candidates for storage on the traditional drive:

  • Swap
  • /var
  • /tmp
  • Virtual machines
  • Automated test script results (jenkins, et. al.)
  • Any other automated build output

The breakdown of what to put on the hard drive and what can go on the SSD is going to vary a bit depending on your usage.  It's probably fine to do your hand-executed tasts off of the SSD, for example -- this being one of biggest benefits of using a sold-state drive.  If you are using an SSD, though, you had better be prepared to consider it a disposable device. Back up all of your non-transient data frequently.

I discussed the Caviar Green Drive in my previous blog article, Evaluate Your Energy Usage.  This low-power drive offers reasonable performance with much greater storage capacity and reliability than an SSD.  When I repair my downed system, I'm going to go back to using a single traditional Caviar Green HD.  I'll probably buy another SSD sometime in the future, but it will be with some consideration and caution.