Putting Theory to Practice: Understanding the SSD Performance Degradation Problem

Let’s look at the problem in the real world. You, me and our best friend have decided to start making SSDs. We buy up some NAND-flash and build a controller. The table below summarizes our drive’s characteristics:

  Our Hypothetical SSD
Page Size 4KB
Block Size 5 Pages (20KB)
Drive Size 1 Block (20KB
Read Speed 2 KB/s
Write Speed 1 KB/s

 

Through impressive marketing and your incredibly good looks we sell a drive. Our customer first goes to save a 4KB text file to his brand new SSD. The request comes down to our controller, which finds that all pages are empty, and allocates the first page to this text file.


Our SSD. The yellow boxes are empty pages

The user then goes and saves an 8KB JPEG. The request, once again, comes down to our controller, and fills the next two pages with the image.


The picture is 8KB and thus occupies two pages, which are thankfully empty

The OS reports that 60% of our drive is now full, which it is. Three of the five open pages are occupied with data and the remaining two pages are empty.

Now let’s say that the user goes back and deletes that original text file. This request doesn’t ever reach our controller, as far as our controller is concerned we’ve got three valid and two empty pages.

For our final write, the user wants to save a 12KB JPEG, that requires three 4KB pages to store. The OS knows that the first LBA, the one allocated to the 4KB text file, can be overwritten; so it tells our controller to overwrite that LBA as well as store the last 8KB of the image in our last available LBAs.

Now we have a problem once these requests get to our SSD controller. We’ve got three pages worth of write requests incoming, but only two pages free. Remember that the OS knows we have 12KB free, but on the drive only 8KB is actually free, 4KB is in use by an invalid page. We need to erase that page in order to complete the write request.


Uhoh, problem. We don't have enough empty pages.

Remember back to Flash 101, even though we have to erase just one page we can’t; you can’t erase pages, only blocks. We have to erase all of our data just to get rid of the invalid page, then write it all back again.

To do so we first read the entire block back into memory somewhere; if we’ve got a good controller we’ll just read it into an on-die cache (steps 1 and 2 below), if not hopefully there’s some off-die memory we can use as a scratch pad. With the block read, we can modify it, remove the invalid page and replace it with good data (steps 3 and 4). But we’ve only done that in memory somewhere, now we need to write it to flash. Since we’ve got all of our data in memory, we can erase the entire block in flash and write the new block (step 5).

Now let’s think about what’s just happened. As far as the OS is concerned we needed to write 12KB of data and it got written. Our SSD controller knows what really transpired however. In order to write that 12KB of data we had to first read 12KB then write an entire block, or 20KB.

Our SSD is quite slow, it can only write at 1KB/s and read at 2KB/s. Writing 12KB should have taken 12 seconds but since we had to read 12KB and then write 20KB the whole operation now took 26 seconds.

To the end user it would look like our write speed dropped from 1KB/s to 0.46KB/s, since it took us 26 seconds to write 12KB.

Are things starting to make sense now? This is why the Intel X25-M and other SSDs get slower the more you use them, and it’s also why the write speeds drop the most while the read speeds stay about the same. When writing to an empty page the SSD can write very quickly, but when writing to a page that already has data in it there’s additional overhead that must be dealt with thus reducing the write speeds.

The Blind SSD Free Space to the Rescue
POST A COMMENT

236 Comments

View All Comments

  • ryedizzel - Thursday, March 19, 2009 - link

    Anand,

    I just wanted to thank you for an amazing article. I am a very picky buyer and technology critic, so I always come to your site for the ‘real’ story on things. In fact for the amount of time, research, and (useful) testing methodologies you invest, I almost feel guilty receiving this information for free. Especially since your findings benefit the industry as a whole since it causes manufacturer’s to fix/improve their products (well at least the smart ones do). The i7 motherboard roundup was another great example of this. Seriously, if you have a place for donations I would send you $50 in a heartbeat. I know it’s not much but if others did the same it would add up to a decent token of appreciation.

    Oh and please don’t take people’s grammar or nitpicky corrections the wrong way. Yes it can be annoying, but in the end it does help the article become closer to perfect since others catch little things overlooked by human error. In the end we are all grateful for these articles, otherwise we wouldn’t be here reading them!
    Reply
  • bsoft16384 - Thursday, March 19, 2009 - link

    You know, the JMicron SSDs really aren't so bad. Yes, you'd have to be crazy to spend $400 on one when there are better options like the X25-M (or the new Vertex series for that matter).

    But I paid $65 for my 30GiB OCZ "Core" SSD. Yeah, random writes are piss slow. I knew this. The drive replaced the 5400.5 that came with my EEE PC.

    I'm not going to be doing any 'extensive multitasking' on my EEE. I'm not running a file server, I certainly don't have antivirus in the background, and I don't spend all day installing new apps.

    I'm running 7. Compared with the 5400.5, the system boots faster, Chrome loads faster, but Windows updates take longer. That's a trade-off I'm willing to deal with, considering that I get less noise and more battery life in return.

    I can tell you this - the JMicron SSDs beat the pants off of the PCIe MLC SSDs that ship with many netbooks.

    So, yeah, I guess this is a product that's "unfit for market". But it's perfect for some of us. If I wanted a boot drive for a Linux media/backup server (along with HDDs for storage), I could see choosing a $50 SSD over a $50 HDD.

    It's all about your needs. No one is pretending that JMicron SSDs are fast, at least not at writing. But if your usage is mostly read-centric (or "nothing-centric", as is frequently the case on netbooks), and your chief criteria are low power and low price, the JMicron SSDs do quite well.
    Reply
  • petersterncan - Thursday, March 19, 2009 - link

    Anand,

    That was an awesome article... and good for you to give OCZ to do the right thing... and they did!

    Kudos also to OCZ for actually listening to feedback and doing something about it.

    Reply
  • Adul - Thursday, March 19, 2009 - link

    Good work Anand :) Reply
  • SSDMaster - Thursday, March 19, 2009 - link

    The stuttering problem with SSD's can be fixed with diskpart. Go do some research before you post an article this massive and convoluted. Reply
  • goinginstyle - Thursday, March 19, 2009 - link

    No it does not, it will help if the partition is properly aligned but it is not a cure, neither is the rest of the voodoo magic being spouted on the OCZ forums. They help, but do not cure the stuttering problem with the JMicron based drives. I just love the fact that OCZ wants to sell you a drive (Core series) that does not work properly, have you purchase third party software, and then hack the OS in order to improve the performance of the product. Glad to see it fixed with the Vertex and Summit drives though, but it will take a long time before I even think about using an OCZ product again. I was hoping to see the new ADATA and SuperTalent drives in this article, maybe those are coming in the next segment he mentioned. Reply
  • SSDMaster - Friday, March 20, 2009 - link

    Yes, it does.
    I have a Core series 60GB OCZ drive. I bought it right before Newegg increased the price on the drives. The stuttering was horrible, and worthless even as a secondary drive if it was formatted with XP. Also, after using Diskpart and aligning the drive I could not install XP on the drive and have it bootable.. Which sucked.

    But there's ways around that, and guess what, I have a stutter free flash drive for cheap that gets very good performance numbers, and boots Server 2008 in under 10 seconds.
    Reply
  • bsoft16384 - Thursday, March 19, 2009 - link

    OCZ's product works fine. You may not like the performance, but it's certainly not unusable.

    The $65 I paid for my 30GiB OCZ "Solid" SSD is about what you'd pay for a USB flash drive. The disk I have has a USB interface, which is very convenient, plus it's plenty fast enough for my EEE PC.

    I'm glad that Anand has done these reviews. People need to understand what they're getting into when they by a JMicron SSD. If you don't expect much, you won't be disappointed.

    Arguably for a normal notebook/desktop you should buy a normal hard drive if your budget is under $100. But the JMicron SSDs do a good job in netbooks (which, again, aren't too fast to begin with) at a very low price.

    I have aligned my partitions and disabled swap on my Windows 7 install (on my EEE). I also have 2GB of memory in my EEE. I haven't done any fancy tweaking on the OS.

    Compared with the EEE 900A that I had briefly (PCIe SSD), my EEE 900HA is dramatically faster. You can't run XP or Vista on PCIe SSDs unless you have a lot of patience. You *can* run it on a JMicron SSD.

    I honestly don't notice any stuttering. I don't run antivirus and I don't multitask much on this machine. If I demanded from my EEE what I demand from my desktop (Q9300 + 8GB + WD6400AAKS), I know that the SSD would choke up. But I'm not going to do that on a 1.6GHz single-core Atom anyway.

    So, yeah, OK. I guess I think that trashing JMicron SSDs is a little like trashing USB flash drives for being slow. Paying $300 for a UFD would be stupid, as is paying $300 for a JMicron SSD. But in the sub-$100 category, you don't expect much.

    When better SSDs drop below $100, maybe I'll upgrade. Until then, I'm enjoying 5 hours of battery life on my 900HA.
    Reply
  • tomoyo - Thursday, March 19, 2009 - link

    Well I think it's unusable for my needs if I'm running it as an operating system drive. I place a giant important on the latency of the drive at that point and it certainly includes random writes. Which is why I would never ever buy an ssd that's majorly below the Intel write performance. It's not worth the price premium or loss of storage size compared to the standard hard drive. Reply
  • Bikerskummm - Thursday, March 19, 2009 - link

    Fantastic article Anand!

    Just a few thoughts:

    I have had some trouble replicating some of the Samsung SLC results...

    Despite filling the drive up and emulating a well used drive as described in the article I cannot get my Sammy drive's performance to degrade as much as you managed to especially regarding random write performance...

    Now my system used for testing is a socket 775 (qx9650) and I was testing on ICH9R and WINXP (SP3) but still I would expect to see similar figures ...

    I do not have an X58 system to test on at the moment but I would be very interested if The Sammy SLC drives were shown to degrade faster / perform worse with a X58 / ICH10R / Vista x64 (SP1?) setup...
    Reply

Log in

Don't have an account? Sign up now