Why SSDs Care About What You Write: Fragmentation & Write Combining

PC Perspective's Allyn Malventano is a smart dude, just read one of his articles to figure that out. He pieced together a big aspect of how the X25-M worked on his own, a major key to how to improve SSD performance.

You'll remember from the Anthology that SSDs get their high performance by being able to write to multiple flash die across multiple channels in parallel. This works very well for very large files since you can easily split the reads and writes across multiple die/channels.

Here we go to write a 128KB file, it's split up and written across multiple channels in our tiny mock SSD:

When we go to read the file, it's read across multiple channels and performance is once again, excellent.

Remember what we talked about before however: small file random read/write performance is actually what ends up being slowest on hard drives. It's what often happens on a PC and thus we run into a problem when performing such an IO. Here we go to write a 4KB file. The smallest size we can write is 4KB and thus it's not split up at all, it can only be written to a single channel:

As Alyn discovered, Intel and other manufacturers get around this issue by combining small writes into larger groups. Random writes rarely happen in a separated manner, they come in bursts with many at a time. A write combining controller will take a group of 4KB writes, arrange them in parallel, and then write them together at the same time.

This does wonders for improving random small file write performance, as everything completes as fast as a larger sequential write would. What it hurts is what happens when you overwrite data.

In the first example where we wrote a 128KB file, look what happens if we delete the file:

Entire blocks are invalidated. Every single LBA in these blocks will come back invalid and can quickly be cleaned.

Look at what happens in the second example. These 4KB fragments are unrelated, so when one is overwritten, the rest aren't. A few deletes and now we're left with this sort of a situation:

Ugh. These fragmented blocks are a pain to deal with. Try to write to it now and you have to do a read-modify-write. Without TRIM support, nearly every write to these blocks will require a read-modify-write and send write amplification through the roof. This is the downside of write combining.

Intel's controller does its best to recover from these situations. That's why its used random write performance is still very good. Samsung's controller isn't very good at recovering from these situations.

Now you can see why performing a sequential write over the span of the drive fixes a fragmented drive. It turns the overly fragmented case into one that's easy to deal with, hooray. You can also see why SSD degradation happens over time. You don't spend all day writing large sequential files to your disk. Instead you write a combination of random and sequential, large and small files to the disk.

The Cleaning Lady and Write Amplification A Wear Leveling Refresher: How Long Will My SSD Last?
Comments Locked

295 Comments

View All Comments

  • Jedi2155 - Monday, August 31, 2009 - link

    Anandtech has always been known for its in-depth analysis, you're just looking for a simple review list. I much prefer these detailed articles than just hearing the list of performance and simple recommendations that most people can write if provided the proper hardware.

    I love how Anand always writes excellent, very well detailed articles that are still SIMPLE to understand. A number of other sites may offer some similar levels of detailed but are sometimes a bit too difficult to comprehend without a background in the same field.
  • KommisMar - Sunday, April 4, 2010 - link

    Anand,

    I read your long series of articles on SSDs today, and just wanted to say thanks for writing the most informative and interesting series of tech articles I've read in years. I've been avoiding SSDs because my first experience with one was horrible. The sustained transfer rates were no better than a traditional hard drive, and the system halting for several seconds on each random write operation was too much for me to stand.

    I was so sick of the SSD coverage that I was reading on other websites because none of them seemed to answer my biggest question, which was "Which SSD won't bring my system to a screeching halt every time it needs to write a little data?"

    Thanks for answering that question and explaining what to look for and what to avoid. It sounds like it's a good time for me to give SSDs another shot.
  • jamesy - Thursday, April 22, 2010 - link

    That about sums it up: disappointment. Although this was a top-caliber SSD article, like i have come to love and expect out of anand, this article didn't make my buying decision any easier as all. In fact, it might have made it more complicated.

    I understand Intel, Indillinx, and Sandforce are good, but there are so many drives out there, and most suck. This article was amazing by most standards but the headline should be changed: removing the "Choosing the Best SSD."

    Maybe "Choosing the right controller before sorting through a hundred drives" would be an appropriate replacement.

    Do i still go with the intel 160 X-25m G2?
    Do I get the addon Sata 6g card and get the C300?
    Do i save the money, and get an indillinx drive? Is the extra money worth the Intel/C300 drive?

    These are the main questions enthusiasts have, and while this article contained a great overview of the market in Q3 2009, SSD Tech has progressed dramatically. Only now, i think, are we getting to the point that we could publish a buying guide and have it last a few months.

    I trust Anandtech, i just wish they would flat-out make a buying guide, assign points in different categories (points for sequential read/write, points for random read/write, points for real-life performance or perceived performance, points for reliability, and points for price.). Take all of these points, add em up, and make a table pls.

    A few graphs can help, but the 200 included in each article is overwhelming, and does nothing to de-complicate or make me confindent in my purchase.

    It's great to know how drives score, how they perform. But it's even important to know that you bought the right drive.
  • mudslinger - Monday, June 28, 2010 - link

    This article is dated 8/30/2009!!!!
    It’s ancient history
    Since then newer, faster SSD’s have been introduced to the market.
    And their firmware have all been updated to address known past issues.
    This article is completely irrelevant and should be taken down or updated.
    I’m constantly amazed at how old trash info is left lingering about the web for search engines like Google to find. Just because Google lists an article doesn’t make it legit.
  • cklein - Monday, July 12, 2010 - link

    Actually I am trying to find a reason to use SSD.
    1. Server Environment
    No matter it's a webserver or a SQL server, I don't see a way we can use SSD. My SERVER comes with plenty of RAM 32G or 64G. The OS/start a little bit slow, but it's OK, since it never stop after it's started. And everything is loaded into RAM, no page file usage is needed. So, really why do we need SSD here to boost the OS start time or application start time?
    For SQL server database, that's even worse. Let's say I have a 10GB SQL server database, and it grows to 50GB after a year. Can you image how many random writes, updates between the process? I am not quite sure this will wear off the SSD really quick.

    2. For desktop / laptop, I can probably say, install the OS and applications on SSD, and leave everything on other drives? And even create page file on other drives? As I feel SSD is only good for readonly access. For frequent write, it may wear off pretty quick? I am doing development, I am not even sure I should save source code on SSD, as it compiles, builds, I am sure it writes a lot to SSD.

    So over all, I don't see it fits in Server environment, but for desktop/laptop, maybe? even so, it's limited?

    someone correct me if I am wrong?
  • TCQU - Thursday, July 29, 2010 - link

    Hi people

    I'm up for getting a new Macbook pro with ssd.
    BUT i heard somthing about, that the 128gb ssd, for apples machines, was made by samsung. I was ready to buy it, but now that i've heard that first of all "apples" ssd's is much slower that they others on the marked. Then i read this. So now i'm really confused.
    What shoud i do?
    buy apples macbook pro with 128gb ssd
    or should i buy it without and replace it with an other ssd? thoughts? plzz help me out
    thanks
    Thomas
  • TCQU - Thursday, July 29, 2010 - link

    Hi people

    I'm up for getting a new Macbook pro with ssd.
    BUT i heard somthing about, that the 128gb ssd, for apples machines, was made by samsung. I was ready to buy it, but now that i've heard that first of all "apples" ssd's is much slower that they others on the marked. Then i read this. So now i'm really confused.
    What shoud i do?
    buy apples macbook pro with 128gb ssd
    or should i buy it without and replace it with an other ssd? thoughts? plzz help me out
    thanks
    Thomas
  • marraco - Friday, August 13, 2010 - link

    Why Sandforce controllers are ignored?

    I’m extremely disappointed with the compiler benchmark. Please test .NET (With lot of classes source files and dependencies). It seems like nothing speeds up compilation. No CPU, no memory, no SSD. It makes nonsense.
  • sylvm - Thursday, October 7, 2010 - link

    I found this article of very good quality.

    I was looking for a similar article about express card SSDs using PCIe port, but found nothing about their performance for rewrite.
    The best I found is this review http://www.pro-clockers.com/storage/192-wintec-fil... saying nothing about it.

    Expresscard SSDs would allow good speed improvement/price compromise : buying a relatively small and cheap one for OS and softwares, while keeping the HDD for data.

    Has anyone some info about it ?

    Best regards,

    Sylvain
  • paulgj - Saturday, October 9, 2010 - link

    Well I was curious about the flash in my Agility 60GB so I opened it up and noted a different Intel part number - mine consisted of 8 x 29F64G08CAMDB chips whereas the pic above shows the 29F64G08FAMCI. I wonder what the difference is?

    -Paul

Log in

Don't have an account? Sign up now