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

  • sunbear - Monday, August 31, 2009 - link

    Even though most laptops are now SATA-300 compatible, the majority are not able to actually exceed SATA-150 transfer speeds according to some people who have tried. I would imagine that sequential read/write performance would be important for swap but the SATA-150 will be the limiting factor for any of the SSD's mentioned in Anand's article in this case.


    Here's the situation with Thinkpads:
    http://blogs.technet.com/keithcombs/archive/2008/1...">http://blogs.technet.com/keithcombs/arc...vo-think...

    The new MacBookPro is also limited to SATA-150.
  • smartins - Tuesday, September 1, 2009 - link

    Actually, The ThinkPad T500/T400/W500 are fully SATA-300 compatible, it's only the drives that ship with the machines that are SATA-150 capped.
    I have a Corsair P64 on my T500 and get an average of 180MB/read which is consistent with all the reviews of this drive.
  • mczak - Monday, August 31, 2009 - link

    article says you shouldn't expect it soon, but I don't think so. Several dealers already list it, though not exactly in stock (http://ht4u.net/preisvergleich/a444071.html)">http://ht4u.net/preisvergleich/a444071.html). Price tag, to say it nicely, is a bit steep though.
  • Seramics - Monday, August 31, 2009 - link

    Another great articles from Anandtech. Kudos guys at AT, ur my no. 1 hardware site! Anyway, its really great that we have a really viable competitor to Intel- Indilinx. They really deserve the praise. Now we can buy a non Intel SSD and have no nonsensical stuttering issue! Overall, Intel is still leader but its completely nonsensical how bad their sequential write speed is! I mean, its even slower than a mechanical hard disk! Thats juz not acceptable given the gap in performance is so large and Intel SSD's actually can suffer a significantly worst performance in real world when sequential write speed performance matters. Intel, fix your seq write speed nonsence please!
  • Seramics - Monday, August 31, 2009 - link

    Sorry for double post. Its unintentional and i duno how to delete the 2nd post.
  • Seramics - Monday, August 31, 2009 - link

    Another great articles from Anandtech. Kudos guys at AT, ur my no. 1 hardware site! Anyway, its really great that we have a really viable competitor to Intel- Indilinx. They really deserve the praise. Now we can buy a non Intel SSD and have no nonsensical stuttering issue! Overall, Intel is still leader but its completely nonsensical how bad their sequential write speed is! I mean, its even slower than a mechanical hard disk! Thats juz not acceptable given the gap in performance is so large and Intel SSD's actually can suffer a significantly worst performance in real world when sequential write speed performance matters. Intel, fix your seq write speed nonsence please!
  • Shadowmaster625 - Monday, August 31, 2009 - link

    Subtle. Very subtle. Good article though.

    3 questions:

    1. Is there any way to read the individual page history off the SSD device so I can construct a WinDirStat style graphical representation of the remaining expected life of the flash? Or better yet is there already a program that does this?

    2. Suppose I had a 2 gigabyte movie file on my 60gb vertex drive. And suppose I had 40GB of free space. If I were to make 20 copies of that movie file, then delete them all, would that be the same as running Wiper?

    3. Any guesses as to which of these drives will perform best when we make the move to SATA-III?

    4. (Bonus) What is stopping Intel from buying Indilinx (and pulling their plug)? (Or just pulling their plug without buying them...)

  • SRSpod - Thursday, September 3, 2009 - link

    3. These drives will perform just as they do now when connected to a 6 GBps SATA controller. In order to communicate at the higher speed, both the drive and the controller need to support it. So you'll need new 6 GBps drives to connect to your 6 GBps controller before you'll see any benefit from the new interface.
  • heulenwolf - Monday, August 31, 2009 - link

    Yeah, once the technology matures a little more and drives become more commoditized, I'd like to see more features in terms of feedback on drive life, reliability, etc. When I got my refurb Samsung drives from Dell, for example, they could have been on the verge of dying or they could have been almost new. There's no telling. The controller could know exactly where the drive stands, however. Some kind of controller-tracked indication of drive life left would be a feature that might distinguish comparable drives from one another in a crowded marketplace.

    While they're at it, a tool to allow adjusting of values such as the amount of space not reported to the OS with output in terms of write amplification and predicted drive life would be really nifty.

    Sure, its over the top, but we can always hope.
  • nemitech - Monday, August 31, 2009 - link

    I picked up an Agility 120 Gb for $234 last week from ebay ($270 list price - - 6% bing cashback - $20 pay pal discount). I am sure there will be similar deals around black Friday. $2 per Gb is possible for a good SSD.

Log in

Don't have an account? Sign up now