Trimming SSD Performance Degradation

Today’s solid state drives are worlds apart from those of just 3 years ago, however they are not yet perfect.  Performance degradation can still be observed through seasoning of the SSD as well as filling it to capacity.  SSD manufacturers have been successful in combating the effects of seasoning but performance degradation when an SSD is filled to capacity seems to be just a bit more difficult.

Typical testing of most drives, through use of random data, will result in an observable performance drop which may start as soon as the SSD is filled past the 70% mark.  This article will describe the common characteristics of SSDs followed by a simple method to ensure that maximum performance is sustained with the drive.

SEASONING

Much has been said with respect to performance degradation as a result of the ssd becoming seasoned over time.  By seasoned, we mean that the drive will eventually use up all of its empty blocks of NAND, or memory and, without TRIM, the process of writing to a drive actually becomes that of reading the block of data, understanding that it is invalid, erasing and then writing rather than simply writing to a clean block. Performance is greater when writing to clean memory vice memory which has previously been used and contains invalid data that has not been cleared.  The root cause of degradation is that when a non-TRIM ssd is told to delete data, it actually only marks the area as clear which leaves the invalid data intact and tricks the ssd into believing that the NAND flash is available.

Data on a SSD cannot simply be over-written as it is done on a hard drive and this gets a bit more complicated when we erase information and the block that it is located on also contains valid information that we dont want deleted.  The process then becomes read data, recognize the valid information, move it to another clean block, erase the present block and write. Manufacturers have tried to combat this issue of performance degradation by creating 3 solutions to the problem which are wear leveling, TRIM and ITGC (or Garbage Collection).

WEAR LEVELING

Wear leveling is the process of the ssd understanding how many times each cell of memory has been written to and then ensuring that all are all written to evenly.  After all, the life span of the ssd is dependent on the total number of writes that are written to and this has been coined as write endurance.  Unlike the hard drive which stores information in a static location, the SSD will move information around on a continuous basis without your knowledge to ensure that all cells wear evenly, thus affording a longer lifespan for the ssd.  By also doing this, the drive can ensure that only the valid information is used, leaving blocks to be cleaned up by TRIM or ITGC, again without the knowledge of the user.

ITGC/GC  (IDLE TIME GARBAGE COLLECTION)

Garbage Collection (GC) is the process by which the SSD recognizes, in idle time, which cells are valid and which are not valid (or deleted) on the drive.  It then clears the blocks of the invalid data to maintain the speed of writing to clean pages or blocks during normal operation.  GC was initially shown to be a last resort if TRIM was not available, however, recent releases are showing new methods to be very aggressive and results equal to that of TRIM are being observed.  This is a huge benefit to those using RAID systems where Garbage Collection is accomplished as TRIM is not an option.

The SSD Review was able to discuss GC and TRIM with Crucial as it pertains to their SATA3 releases as it has been observed that their RealSSD C300 SATA3 drives do not appear to show any performance degradation over extended use.  Crucial confirmed that they had to consider that TRIM would not pass through the present release of SATA3 drivers which helped recognize that very aggressive GC would be necessary for the C300 SATA 3 SSDs success.  The subsequent result was that many forum threads were created by avid users who were questioning whether TRIM was, in fact, working in their SSDs as no performance degradation was seen even in the toughest of test beds.  To dispel a common belief, it is not the Marvell processor of the Crucial RealSSD that prevents TRIM from being passed, but rather, that of the hardware and drivers of SATA3 capable motherboards.  All Crucial SSDs are fully capable of passing TRIM direction to the OS.

TRIM

TRIM occurs when the ssd clears blocks of invalid data.  When you delete a file, the operating system will only mark the area of the file as free in order to trick the system into believing the space is available. Invalid data is still present in that location.  Its like ripping out a Table of Contents from a book.  Without this, one would not know what, if anything, is contained on the following pages.  TRIM follows the process of marking the area as free by clearing the invalid data from the drive.  Without this, the process of reading, identifying invalid data, deleting or moving and clearing the block before writing can actually result in performance 4 times slower than it would have normally been as a new drive.

In recently speaking with Kent Smith, Sr. Director of Product Marketing  for SandForce, he identified that there are many variables outside of the hardware that are responsible for users not seeing the benefits of TRIM, the first of which are drivers at the OS level which have to be working optimally in order for TRIM to function correctly.  Another example occurred with early Windows 7 users testing their newly installed drives and not seeing the benefits of TRIM.  Examination of these complaints revealed that users would have originally made the Windows 7 installation on hardware that did not support TRIM and then cloned to the SSD to which TRIM was supported but would not work because of the original configuration settings.  The same could be said of cloning an OS that originally had AHCI turned off followed by a clone to the SSD where TRIM was not being passed, simply because AHCI has to activated for TRIM to function.

ENHANCE SSD OVER PROVISIONING MANUALLY

In our conversation, we breached the topic of SSD capacity to Mr Smith to which he replied, Are you trying to optimize performance or maximize capacity? which reminded us that the main purpose of the consumers transition to SSD was to maximize their system performance.  Filling a drive to capacity will hinder TRIM and GC ability which will result in performance degradation. Many drives will start to display performance changes once filled to 70% capacity. Testing has shown that the user can very simply add to the drive, especially if it is a 7% over provisioned drive, by reducing the size of the partition, the new unallocated space of which will automatically be picked up as over provisioning and benefit the SSD in many ways.  This idea has been tackled by Fusion IO who includes a utility within their products that allows the user complete control of the size of their over provisioning.

blank
OWC 120Gb SSD With 16x8Gb NAND Flash = 128Gb Total (7% OP)

Over provisioning allows more data to be moved at one time which, not only enhances GC,  but also reduces write amplification to the drive. Write amplification is a bit tricky of an explanation but it is the measure of how many bytes are actually written when requiring storage of a certain number of bytes.  A ratio of 1:1 would be ideal but not a reality and a typical result would be an actual size of 40kb written for a typical 4kb file.  In short, maximizing over provisioning and reducing write amplification increases the performance and lifespan of the drive.  Over provisioning also provides for remapping of blocks should the bad blocks be discovered during wear leveling, which unlike a hard drive, does not reduce the end user capacity of the drive. The replaced blocks simply come from the over provisioning.

At the end of the day, the end user can hold one final piece of comfort when transitioning to an ssd from a hard drive.  Unlike the hard drive, the ssd does not alert the user of its end life through a typical crash where data can be next to, if not, impossible to retrieve.  The SSD still continues to be a readable resource for data stored, however, cannot write new information to the drive any further.

9 comments

  1. blank

    Thanks for putting this up Les! yes every tech forum on the net has atleast 1 post on TRIM and performance, great to see you addressed it.:) cheers and keep up the great work!

  2. blank

    Good read. Thanks for sharing this info!

  3. blank

    The biggest argument I have against enabling TRIM is that TRIM is a SATA-only command.

    SSDs attached via PCIe, USB 3.0, FireWire, or Thunderbolt cannot receive the TRIM command. Macs won’t even recognize them as SSDs nor would the Mac send them the TRIM command even if it is enabled.

    The newest MacBooks now use PCIe SSDs.

    SSDs (such as OWC Mercury SSDs with SandForce controllers) have evolved to the point they don’t need TRIM – particularly when the SSDs are not attached via SATA? They do their own garbage-collection and optimization.

    OWC – in particular – advises against enabling TRIM on their Sandforce controller OWC Mercury SSDs since this increases wear and tear on their SSDs. TRIM adds extra unnecessary writes when the SSD already did this on its own. Enabling TRIM would essentially harm the SSD and shorten its lifespan. https://blog.macsales.com/11051-to-trim-or-not-to-trim-owc-has-the-answer

    If modern SSDs need TRIM, they would be in danger of serious performance problems if the SSD was attached via a non-SATA connection such as USB 3.0 or PCIe or Firewire or Thunderbolt. Unless the manufacturer insures their SSD’s controller does its own version of TRIM, then they would suffer serious performance problems when attached via non-SATA connection compared to the competition.

    This is why I argue that TRIM is currently useless in modern SSDs.

    • blank

      Although a dated article, the argument is a valid one, however, is primarily based on LSI SandForce controlled SSDs in this argument. Can your same opinions be reflected for all manufacture of SSDs today?

      • blank

        Since SSDs sooner or later are going to take over Rotational Hard Drives for external USB 3.0 general purpose storage, it should be true that TRIM is no longer needed. USB 3.0 drives will not receive TRIM commands even if TRIM is enabled.

        Since you test SSDs on this site, I think you would be most expert in determining if SSDs installed in external USB 3.0 enclosures have performance degradation over time since they won’t be capable of receiving the TRIM command.

      • blank

        Unfortunately I am not an expert, nor would I jump at that designation for many in this industry but you answer your question right off when you spoke of garbage collection in SF drives.

  4. blank

    Hi Les,
    I understand the concept and value of overprovisioning but not how best to implement it. Some writers say it is enough to just leave empty space on the drive in the same partition as the OS whilst others say it is necessary to make an unallocated partition which will then be used by the controller as overprovisioned space. I wonder if you could clarify this. I am using OCZ Vectors.

Leave a Reply

Your email address will not be published. Required fields are marked *