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.
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.
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.