KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Why does TRIM matter for SSDs?
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: February 10, 2011

Plaese note: the information in this Tech Tip applies to flash-based SSDs (in particular, MLC flash SSDs).

When considering flash-based SSD drives for a 4D installation it is important to understand the purpose of the ATA command called TRIM. Typical enterprise IT installations focus on things like RAID support and specific OS's. When considering SSDs it is important to take some new factors into account:

  • The only 4D certified OS's that currently support TRIM are Windows Server 2008 R2 and Windows 7.
  • There is no SSD that supports TRIM in RAID.
  • There are proprietary TRIM-like solutions for many SSD drives but you still must investigate whether or not these features work on your host OS and/or in a RAID configuration.

So why does TRIM matter? Here is an overview:
  • SSDs are structured in “blocks”, which contain “pages” of memory.
  • SSDs can read individual pages, but can only delete whole blocks.
  • So in order to perform a page deletion, the SSD must read the entire block into memory, figure out which pages are really deleted, and write the block back.
    • In fact this is a bit of a lie: SSDs don’t delete at all.
  • When you delete a file nothing happens at all in the SSD. The file is deleted from the OS file allocation table, but no modification is made to the disk. This is pretty much the same principal with mechanical HDDs; it’s also why data recovery is possible. So the issue is the SSD does not know which pages are deleted…
  • What happens is, over time all blocks will become occupied (they will contain some occupied pages). Some of these will be deleted files. So when it goes to write some changes, the SSD will need to first read the block, delete any empty pages, write the changes, and write the block back. I.e. every write becomes a read+edit+write. This is called "write amplification" and it results in performance degradation.
  • TRIM is an ATA command that was introduced to alleviate this performance degradation. If an OS (and drive) support TRIM, the OS maintains the necessary information in order to inform the drive which pages have been deleted. Thus the SSD doesn’t need to do the read+edit+write dance. It can just write the changes.

The performance degradation is finite. It stops degrading once all blocks contain occupied pages. Current benchmarks indicate that drives without TRIM (or on OS’s without TRIM support) degrade by 25-35% performance and then don’t get any worse. In the end it’s still faster than an HDD.

But without some form of TRIM (either support for the standard TRIM command, or some proprietary solution) the only way to “fix” this problem is to reformat the drive, at which point the degradation starts again.

Now, you might ask, “why would all blocks be occupied of the drive is not full?” All SSD’s use a feature called "wear-leveling" when writing data. What this means is, for example, if you write a 2GB file, it is split up into blocks (usually ~512KB) and written all over the disk; i.e. it is *intentionally* fragmented. This works because SSDs don’t have a seek time (no mechanical parts) so fragmentation is not an issue. This is done because flash memory cells support a finite number of writes before they fail. Wear-leveling ensures that no single cell is being excessively written to.

In conclusion, when evaluating SSDs for a 4D installation, it is important to take TRIM support into consideration.

Commented by Josh Fletcher on February 17, 2011 at 11:02 AM
This Tech Tip previously mentioned that Intel x25 SSDs support TRIM in RAID. In fact this was not correct and Intel has indicated that this was a documentation error. The Tech Tip has been updated to reflect this.