Thursday, January 13, 2011

Care and Feeding (TRIM Support) of SSD's in Apple's Mac OSX

This article is part of my Virtual Lab Series.

As a follow up to yesterday's article on installing an SSD in my Mac, the next question is now what?

Before I start loading virtual machines for my virtual lab I wanted to relay some information on TRIM support and Mac OSX.  First, what is TRIM?  According to the Wikipedia TRIM entry:

In computing, a TRIM command allows an operating system to inform a solid-state drive which blocks of data are no longer considered in use and can be wiped internally.
TRIM was introduced soon after SSDs started to become an affordable alternative for traditional hard disks as permanent storage in PCs. Because low-level operation of SSDs differs significantly from traditional hard disks (see details below), the typical way in which operating systems handle operations like deletes and formats (not explicitly communicating the involved sectors/pages to the underlying storage medium) resulted in unanticipated progressive performance degradation of write operations on SSDs.[1] TRIM enables the SSD to handle garbage collection overhead, that would otherwise significantly slow down future write operations to the involved blocks, in advance.[2]
Although tools to "reset" some drives to a fresh state were already available before the introduction of TRIM, they also delete all data on the drive, which makes them impractical to use for ongoing optimization.[3] More recent SSDs will often contain internal idle/background garbage collection mechanisms that work independently of TRIM; although this successfully maintains their performance even under operating systems that do not (yet) support TRIM, it has the drawback of increased write amplification and associated increased wear of the flash cells.[4]
Why is this a big deal?  Simply put, without TRIM, your SSD performance will degrade over time.  The problem here is Mac OSX doesn't support it!  Most operating systems these days support TRIM but old Steve Jobs doesn't consider this a high priority right now (even though he's pushing SSD's in just about every model they sell - trying to keep the Genius Bar fees up maybe?).  As they would say in Princess Bride, "Inconceivable!"

I have found two articles very useful to maintain the performance of the SSD overtime.  In a nutshell, right now you have to wipe the drive every so often and perform a manual TRIM.  Although this isn't ideal, it isn't a large issue considering how easy it is to reinstall (or clone) the SSD on the Mac compared to Windows.  Here are the articles:

That's what I have found so far.  Am I missing anything?  If so, please leave a comment!

4 comments:

Aaron Patten said...

The Vertex 2 drives support garbage collection in the firmware, so hypothetically they should 'self maintain' their performance even without TRIM support in the OS.

Aaron Delp said...

Good to know Aaron! Thank you and I will check it over time and let you know!

Charles said...

Check out DiskTester, it has a "recondition" function for SSDs.
Re: http://diglloydtools.com/disktester.html

And as Aaron mentioned earlier, newer SSDs with modern controllers don't suffer nearly as much from write degradation over time as the older units did.
Example: http://macperformanceguide.com/Reviews-SSD-OWC-Mercury_Extreme.html

Anonymous said...

The reason Apple doesn't care is that all the SSD's they sell have garbage collection so adding TRIM support hasn't been a high priority. It's one advantage of the fairly closed hardware ecosystem of the Mac =)