Debunking SSD lifespan and random write performance concerns

A number of customers have been concerned about durability of SSDs; some have worried about random write performance as well. Since many mongoDB users have reported good results, I thought I’d take the time to analyze some of the concerns to assist others who are considering a move to SSD. Now, not all SSDs are created equal; I would recommend high-end enterprise-grade SSDs (like the Intel X25-E) for database applications; my analysis will focus on this grade of SSD.

Durability

The short answer is I wouldn’t worry about it.

For applications which are heavy on random writes, you’re OK (meaning a life span of over 5 years) up to about 25 million writes per day per drive, which is nearly double the IO capacity of the fastest hard disk drives. For sequential write heavy applications (which benefit far less from SSDs), you’re OK (same 5 year life cycle) assuming the application re-writes each block on average no more than once per half hour; the smallest size of the latest fast HDD’s can barely manage this (take a Seagate Cheetah 15k.7 at 300GB for example, which has a claimed sustained write throughput of 171 MBps), and it gets harder as disks get larger.

I should point out that applications which do nothing but sustained disk writes are unusual to say the least; most applications mix in some writes and have a varying load which doesn’t keep the disk subsystem pegged continually. But even in this pathological case, you have a lifespan of 5 years for any application within the performance envelope of HDDs. And with an even mix of reads and writes and a (fairly typical) 5:1 ratio of peak to average usage, your SSD will last 5 years at 10x-20x the load that an HDD can handle. For applications with a higher mix of reads, the situation looks even better.

If you’d like to analyze this yourself, I will introduce you to two concepts you need to consider: wear leveling and write amplification. Both can increase workload/decrease lifespan so I’ll explain them here.

  • Wear leveling is an important process where the SSD ensures that the same blocks are not being re-written constantly. Intel quotes a 1.1x wear leveling factor for the X25-E; that means there’s an overhead of an additional 10% of writes going on to prevent hotspots. Because its not hard to come up with algorithms that lazily balance wear with minimal overhead (not hard, but not too easy, I might use it as an interview question), I tend to trust that estimate and not worry much about that factor. I did leave room in my lifecycle calculations for this 10% factor.
  • Write amplification is the ratio of data physically written to the SSD relative the data logically written by the user. One large factor in write amplification is the large number of pages (typically 4-8k) in a block (typically 128-256k) and the fact that all erasing is done a a block level, potentially causing significant garbage collection and re-writing overhead. While Intel claims 1.1x write amplification for the X25-E, I’d be a bit cautious about accepting that as gospel; minimizing write amplification depends in large part on separating static and dynamic data, which can be very hard to do (and impossible given worst-case random IO patterns). That said, my previous calculations don’t depend on any specific efficiency in that regard – I baked in a worst-case assumption for the random writes, and for sequential writes there is much less of an issue here.
For those who don’t trust my math on durability, how did I calculate these numbers? For the random writes, a 64GB SSD has 500,000 blocks of 128k. Assuming a lifespan of 100,000 write cycles per block, you get a total of 50 billion writes for the disk, minus 10% for wear leveling give 45 billion usable writes. Divide that by the number of days in 5 years and I get 25 million per day. For the sequential writes, I allowed 90,000 usable write cycles of the whole disk (again allowing 10% for wear leveling). Dividing 5 years (which happens to be just over 43000 hours) by 90,000, and you get just over 29 minutes per cycle. For the Cheetah comparison, I divided 300GB by 171MBps and again got 29 minutes per cycle.

Random write performance

I’ve heard complaints that SSDs (even high end ones) are slow for random writes. Short PG-rated answer: baloney.

Longer answer: “slow” is relative: SSDs are much slower (around 11x for our old standby X25-E) at random writes than they are at random reads, but they are much faster (15-20x difference between the X25-E and a Seagate Cheetah 15.7) at random writes than are hard drives.

It’s kind of like complaining that cars are slow in reverse: they’re quite a bit slower in reverse than in drive, but they still back up a lot faster than a horse backs up, so don’t use that as a reason to stay with a horse for your transportation needs.

Some more detail: SSDs are around 10x slower at reads than they are at writes: 3300 IOPS vs 35,000 IOPS for the X25-E using Intel’s numbers, with similar results duplicated by independent testing (for example, ACM Transactions on Storage reported 3120 vs 33,400 in September 2010). With 2ms of rotational latency and around 4ms to seek, expect around 150-200 IPS for a 15k RPM HDD.

Hope this post helps clarify the situation and gets more people taking advantage of this technology.

— Max

17 comments so far

  1. Cliff Elam on

    Funny, I read a story on that problem a year ago, did a back of the napkin calculation, and figured that you might get three years tops.

    I suspect you are much more right (write?) than that.

    But cast your mind back to disks from three years ago. Exactly. Who cares how long they last.

    I’m getting ready to replace my desktop external 1.5TB drives with 4TB drives. The 1.5TB’s were $300+ only eighteen months ago, the new 4TB’s are $223. And faster.

    (I ripped all my movies onto disk for in-house streaming and I love movies. Nothing else. Really.)

    So what, that is consumer. But the energy consumption of the new drives is 3/5 that of the old drive. So 2.5X the capacity at 60% of the running costs. It’s been a long time since I racked hardware, but that is probably a no brainer capital refresh approval.

    -XC

    • Max Schireson on

      Yes, spinning disks are improving quickly too.

      You can do a calculation which shows that you can burn through an SSD in 6 months, but that’s at a pure write IO workload well beyond what a spinning disk couldn’t even attempt to keep up with. So there may be a few corner cases where you want to go to RAM-based SSD, but I can’t find any large scale workloads where you want to fall back to traditional HDD due to lifespan issues.

      Whether SSDs are worth the cost is another question; I certainly wouldn’t use them for storage of movies at home!

  2. Micker on

    Assuming a lifespan of 100,000 write cycles per block..

    LOL, all the new 25nm ssd drives are rated at 3000 write cycles per block, down from 5000 for the 34nm. Where did you pull the 100k from, SLC memory??

    • Max Schireson on

      Yes, I was referring to SLC memory as used in higher end SSDs like the X25E. Completely different story with lower end consumer MLC drives, I’d be very careful about lifespan there.

      — Max

    • Max Schireson on

      Yes this analysis was for doc based ssd.

  3. ErikO on

    Hi,

    About the ‘be careful with MLC drives’… I can concurr:

    Having had MLC drives from OCZ (all bad), X25M 160 G1 (worlds better, but still the odd skip from day to day when listening to music – i.e. not acceptable), and now I have the 64GB X25E which is SLC. The X25E is EVERYTHING I hoped an SSD would be, since years ago when I had my iRAM disk.

    In fact, so flawless is this as my boot disk (and all my apps – except VMWare partitions), er, no, let me say this in another way; so flawless in every manner except disk space is the X25E, that it will be a warm day in Minsk before I ever purchase another MLC drive again.

    I feel guilty for having recommended MLC drives based on reviews, to my colleagues, before actually owning one myself…

    BTW: 14.5GB of free disk space after 6 months use. (I keep C&C3 on there which is big).

  4. […] Debunking SSD lifespan and random write performance concerns […]

  5. M on

    FWIW: We burn through SSDs in about 4 months on our DB boxes. We plan for the failure, and the performance is worth it (one year warranty means we only have to pay for the drives once a year, even though we get bulk-shipped replacements monthly)

    Not for the light of heart, if you have really heavy DBs.

    • Max Schireson on

      Are you using enterprise level / SLC drives? More expensive but last much longer.

  6. zebestov on

    Stop me if I’m wrong, but it seems your lifespan is the time it takes for *every single bit on the drive* to be burnt. Sorry but I think having 10% of the disk in error is already an issue. Does that mean that lifespan is now 6 months ?
    I guess the SSD tries to get more or less the same amount of writes per block, but it’s probably not perfect, just like the 100k writes lifespan is not a fixed limit but an (optimistic) average estimate

    • Max Schireson on

      Yes, it is for the while disk. They include a reasonable amount of overcapacity to cover 10% being burnt out – not a problem if you have 20% or more spare 🙂

      — Max

  7. John S on

    What I have heard too is that the cheaper SSD drives are more prone to failure and its typical of cheap HDD too. So price does tend to buy time.
    I have a 2010 Macbook Air with a Apple SSD 256GB. Its hard to tell from what Apple gives you what the quality is. But from speed charts of drives I found the Apple drives do not look to be so great. I back up at least every two week if not more. I have already started reading more complaints in Apple forums on SSD failures after a couple years. Macbook Air’s have not been out that long. If I had it to do over, I would have bought a Macbook Pro with a nice 7200RPM drive. I would gladly give up a small amount of speed for more space.

    • Max Schireson on

      Yes, the consumer MLC flash drives as in laptops don’t last as long. But I still love my Air with SSD!

  8. Jilsx on

    Max, I think your calculations assume that there is 100% (-10% for burned cells) available for writes. In real life the disk will be filled with data, so there is less walking room available. Or do you mean that the garbage collection will move blocks around in order to prevent wear leveling?

    Not trying to be a wise-ass, generally trying to understand your train of thought.

    • Max Schireson on

      Been a while since I wrote this. What I did is set aside 10% of the total write capacity of the disk to move things around to prevent hotspots (wear leveling). I then assumed that the write load was evenly distributed across the disk. Yes, it might br full of data, but the job of the wear leveling is to shuffle things around so that you don’t burn out any particular spot. The manufacturer overprovisions some additional storage (beyond what is advertised as capacity) to help make that happen.

      — Max

  9. Hawk on

    Why can’t they make it last forever? 😥

  10. David Orser on

    Thought I’d toss in my experience for comparison. I have a 80GB Intel M2 MLC drive in my desktop and a 160GB Agility 2 (MLC) in my MacBookPro. Both have performed at a level that makes any 3.5″ drive based computer look like its standing still. I haven’t a clue what you did to get stuttering on an Intel or post Sandforce 2 drive, but I have significant doubts that it was the SSD. I acknowledge there were reports of stuttering on the first gen non-Intel drives, but those days are *long* past.

    My laptop has written 3.3TB’s of data in about 1.4 years. The Agility 2 has 7% over provisioning and I usually run pretty full with 10% free space. The 34nm MLC FLASH is usually spec’d at 5k writes.

    (0.16 TB * (10% + 7%) * 5,000) / (3.3TB/1.4 years) = 57 years

    Now even if you look at 25nm flash with 3k writes, you’re still talking a very long life time. I consider my usage high. Anand @ anandtech.com claimed he got around 8GB/day or 3GB/year. Which isn’t far off my numbers above.

    I don’t have detailed information on my desktop, but the usage is much lower, especially in writes, as I just use it for occasional gaming these days.

    Obviously, I’m very much centered on the consumer side of things so I have little insight into the server database comments above. However, for a laptop you really can’t go wrong with an SSD these days.


Leave a comment