All Flash–based storage devices, SSDs included, are unique in the way they deal with previously deleted data. When a file is deleted in Windows or any OS, the file still exists on the storage device, be it an HDD or SSD. For the purpose of this document, we will call data deleted by the OS but still residing on the storage device “Garbage Data”. In the case of a file deletion, the OS assumes the address where that file resided is now empty and can be written over again when needed. When the OS issues a command to write data to a location that previously contained data, the HDD will write over the garbage data with no issue. With all NAND Flash-based storage (USB Flash drives, SD cards, SSDs etc) that is not possible. The SSD will need to erase the contents of the memory cell before writing to it. This process of recycling previously deleted data is known as Garbage Collection. The garbage collection process and strategies are programmed in the SSD controller firmware and differ amongst drive manufacturers.
Drives that employ an efficient garbage collection process display good performance out of the box but also months later whereas drives that don’t, tend to slow down over time. The slow down stems from the controller on the SSD having to deal with recycling all the blocks with garbage data.
When Microsoft released Windows® 7 it was touted as the first “SSD–aware OS” and upon recognizing an SSD installed in the system, the OS will disable some features related to improving HDD performance that is not needed by the SSD. It also enables one SSD specific optimization, called the TRIM command. Simply explained, the TRIM command enables the OS and the SSD to now communicate where the garbage data is and mark it for deletion.
With TRIM enabled in the OS, when a file is deleted, the OS will now communicate that the address where the file resided can be cleaned when the drive finds a convenient time to do it. To enable this feature the SSD must support the TRIM command. Note that all Kingston SSDs do support the TRIM command. The TRIM command is an effective feature that enables consistent performance for SSDs over time but does have limitations. It is dependent on being able to communicate with the drive via SATA interface. If SSDs are configured in a RAID array, connected to a HBA controller or sitting in a NAS/SAN configuration outside of the host PC, the TRIM command will not reach the SSDs.
On that note, recent data taken from our enterprise customers show that Windows XP is still the dominant OS used in their environments. With that in mind, we set out to test the effectiveness of Garbage Collection vs. TRIM and how it affects SSD performance.
To test this scenario, we wrote a utility that completely fills up the SSD with data, erases the drive and then fills it up again, measuring the delta in time between the first fill and the second fill. By completely filling up the drive, deleting everything and then immediately filling it up again, we are forcing the controller on the SSD to “garbage collect” the entire drive while simultaneously writing new data to the drive.
We configured the SSD as the D: drive connected to a SATA 2 port in a Windows7 system and ran this “fill – delete – fill” test with the TRIM command turned on and then turned off, to simulate all the non-TRIM OS’s such as XP, Vista, Mac OS X. In addition, we’ve run another test with SSDs configured in a way, that the TRIM command cannot reach the drives (RAID, SAN). Finally we ran the PCMark
Storage benchmarks to test overall drive performance during this test. During all tests, we included a 5400RPM HDD to use as a point of comparison. See below for test results.
Note the first runs on each drive were the fastest on fill time, as we first secure erased the drive to simulate the new out of box performance. In these tests, both the KC100 and the V+100 drives displayed steady and consistent performance runs 1-3 with the TRIM command turned on and in R4-R6 with TRIM turned off they continue to display the same performance. SSD1, SSD2 and SSD3 all exhibit consistent performance while TRIM is turned on, but note at the beginning of Run 4, SSDs 1 and 2 take a longer time to complete our “fill-delete-fill” tests and SSD3 for reasons unknown, displays very inconsistent performance. Keeping in mind that we turned the TRIM off at the end of R3, meaning the drives no longer have the TRIM command to flag where the garbage data is. The drives’ “garbage collection implementation” is being severely tested in Runs 4 to 6 (R4-R6). Test runs R4–R6 represent drives performance in a non-TRIM OS’s such as Windows XP, Vista and MAC OS X.
The PCMark Storage Suite was run immediately after secure erase to get the best possible score, after run 3 with TRIM still on and then after run 6 with TRIM turned off. As you can see on the graph, both Kingston drives continue to perform well with or without the TRIM command enabled. There is a slight drop in overall score comparing to the R1 score but again that was after a secure erase when the drive was completely empty with no garbage data residing on it. SSD1, 2 and 3 all show a significant drop in score from R3 to R6. One comment we hear regarding SSDs is not about the fast performance was when they were brand new, but how they appear to slow down after consistent use. This test illustrates that, to some degree, once all the NAND in an SSD has been written to once, the controller is forced to recycle garbage data to perform any new writes, drives that do that well maintain steady performance and drives that don’t slow down. Important thing to note is that all of these scores at R6 with TRIM OFF are still well above a typical HDD score of approximately 2600 in this Storage Benchmark.
All NAND Flash–based devices have to deal with previously deleted data by erasing the contents of a memory cell before writing new data. Garbage Collection and TRIM command are both effective ways for an SSD to recycle “garbage data”. The TRIM command does have some limitations mentioned above, most notably not being able to communicate with SSDs in a RAID array and lack of its implementation in older Operating Systems. While an SSD with an effective Garbage Collection process will recycle the garbage data without sacrificing performance in any operating environment. Kingston KC100 and V+100 both employ very efficient garbage collection strategies but not all SSDs. In our testing, we saw a few SSDs that slowed down once the TRIM command was turned off. When considering a move to SSD technology, IT specialists and purchasers should remember to factor in what the host OS will be and what configuration the drives will be in.
Note that the used Kingston SSDs in this test SSDnow KC100 as well as the SSDnow V+100 are older products and not available for purchase anymore!!! However, the results from this 2011 test show the general effects of garbage collection and trim on SSD performance.
Picture copyright: Kingston Technology Inc.
Michael Nuncic is Marketing Communications Manager at the German Ontrack Data Recovery office in Böblingen for more than 5 years. Highly experienced in computer, network and software topics, he is a professional editor for blog and technical articles for almost 20 years now.