Hacker News new | past | comments | ask | show | jobs | submit login
Mac OS X SSD tweaks (nullvision.com)
62 points by bensummers on April 16, 2010 | hide | past | favorite | 37 comments



Given that Intel SSDs are claimed to support writing 100GB of data every day for five years before losing the ability to write, and I rarely hit even 10GB written in a bus development day according to OS X's Activity Monitor, I'm uncertain if these tweaks will make all that much of a difference in the lifespan of the drive.


For what it's worth my first Intel SSD (X25-M G1) died in under a year and I wasn't pushing anywhere near that much data.


It's not so much the lifespan, it's performance degradation after lots of the drive has been written to. It's not a permanent problem, but I know lots of people who notice and end up formatting to regain their performance.


As far as I'm aware, TRIM takes care of the performance degradation. Not sure that OSX supports TRIM yet though.


OS X does not support TRIM.

TRIM is only enabled on the G2 Intel SSDs and newer competing models, the original G1 does not have the instruction.


And using a drive firmware that expects TRIM results in a massive regression when the kernel isn't regularly telling it to trim blocks, as it disables its normal GC.

The Intel GC algorithm was great. I would have preferred it if they had simply ignored all the 'power user' fanboys that constantly harp on about how it would somehow save the day. Let them buy other drives, and leave more for the rest of us.


If G2s are shipping with TRIM firmware, couldn't you just downgrade to a pre-TRIM version if you're so concerned?

I don't understand how running Win7 makes you a 'power user fanboy' as opposed to running OSX or Linux. Next time leave the second half of your comment off, and maybe provide some evidence for your first.


Or it would if OS X supported it.


Another way to save (the oh so precious) space on SSDs is to apply HFS+ compression to files.You can use ditto(1) or this GUI: http://latenitesoft.com/squeeze/

Note, however, that files are decompressed on writes, so don't try it on anything large and frequently written to.


Sadly, no performance data is provided.


Here's a link to a more recent post in other blog http://damieng.com/blog/2010/04/09/macbook-pro-upgrade-to-cr... — Author switched original 320GB MacbookPro HDD with a Crucial 256GB SSD, it provides benchmarks and compared perfomance and an interesting points:

Don’t go with Apple’s factory-options for an SSD as they use slower Samsung drives and charge a premium for it which is unacceptable especially given how easy they are to replace.

Which I hope, if true, Apple will fix by adding high-end SSD options in the near future


Intel only sells their awesome SSDs retail, as demand far outstrips their inconsistent supply. When they get their production up and start offering them to OEMs, expect Apple to start using them.

I don't see Apple using any of the mediocre inconsistently-performing Taiwanese SSDs.


IIRC, Apple's very first SSD offerings were based on Intel SSDs. The move to Samsung came when Apple decided to go leadfree/halogenfree/eco-friendly and the Intel chips didnt have the correct qualifications.


I don't think so, I'm pretty sure the first Macbook Air was released before Intel's public efforts, the performance was pretty mediocre (not better across the board than a 2.5" laptop HD, only the terrible 1.8" iPod HD that would fit), and Apple has had multi-billion-dollar contracts with Samsung for flash memory since the iPod nano.


For what it's worth, here's a link to my review/how to of an X25-M G2 RAID 0 array on my MacBook Pro with some basic benchmarks: http://paulstamatiou.com/how-to-apple-macbook-pro-raid-0-arr...


But these are not tweaks to optimize performance - they're for reducing the number of writes to the SSD somewhat. Now that I think of it, one could indeed view those writes as a performance metric (better being: less writes).


Is it really better, or is it just a fell-good thing? What if reducing number of writes has no practical consequences at all? There is no data provided to judge either way.


When an SSD modifies a page, it has to erase & rewrite the entire block. SSDs try to avoid this by marking the block as “free” and writing data to an entirely different block, if one is available.

The point here is that in order to write a tiny bit of data, SSDs have to write to a larger portion of the drive (usually).

So reducing the # of tiny writes should lengthen the lifetime of the drive. It's theory, but the theory is sound enough to me to optimize for it if there's little or no downside to the optimizations.

Edit: though, as noted elsewhere, these drives will generally last more than long enough, so the effort is probably unnecessary.


Cells in an SSD have a finite number of writes. But some brief Googling convinced me that with current drives, the number of writes a cell can take is not a concern even for heavy use.


IMO these go beyond tweaks and are more like SSD ricing.


noatime is a great counterexample to your 'ricing' claim. I run this mount option on nearly every filesystem under my command. relatime is also a viable option if you need things like mutt.

From http://kerneltrap.org/node/14148 (which discusses relatime, a less-drastic version of noatime that keeps mutt working)

> Ingo Molnar stressed the significance of fixing this performance issue, "I cannot over-emphasize how much of a deal it is in practice. Atime updates are by far the biggest IO performance deficiency that Linux has today. Getting rid of atime updates would give us more everyday Linux performance than all the pagecache speedups of the past 10 years, _combined_."

> "It's also perhaps the most stupid Unix design idea of all times. Unix is really nice and well done, but think about this a bit: 'For every file that is read from the disk, lets do a ... write to the disk! And, for every file that is already cached and which we read from the cache ... do a write to the disk!'"


What's the issue really? There are three things mentioned, none of which is very controversial (okay, so part of the last one is).

* noatime - which is a standard setting on Linux these days

* Remove the hibernate file - which is valid, if you know the tradeoffs. And the author does describe them sufficiently.

* Move temporary files to ramdisks - this is a pretty common speedup too. The controversial part is what to put in the ramdisk.


For those like me who came away from this wondering what windows tweaks were available, I found a good thread here: http://www.ocztechnologyforum.com/forum/showthread.php?47212...

It is a lot of the same types (ramdrives, no hibernation) of changes but for windows users.


Is there really a serious issue in the way OS X handles SSDs?

I think I want to replace my MacBook’s hard disk with an SSD, but I’m afraid of having to spend hours rigging out the best configuration. Do you have to play with settings if you order a Mac from Apple with an SSD pre-installed?

It seems like if I want to just plug an SSD in and get on with my life, I’ll have to wait for an OS X update. Unless this is all just PC-ricer talk that’s safe to ignore…


I installed an SSD in my MBP some months ago, and it is fantastic. Just do it. Don't worry about hacking the settings--the OS folks at Apple will eke out the last few percent of perf for us when they get around to it.


As long as you leave plenty of free space, SSDs work great out of the box. Don't ever fill them (something beyond 80% capacity), or you will crush performance. The tweaks in the article are attempts to optimize for the last 2%, but in no way necessary.


Since you're going to be reading and writing to the drive repeatedly, the drive is always going to hit the write performance crunch no matter what you do (unless you support TRIM - Windows 7 does with the correct drivers, OS X does not, not sure about Linux).

However, even degraded, write performance of a modern SSD will still make a hard drive look like yesterday's news - so honestly, I wouldn't even worry about it at all.


SSDs do degrade by around factor ten (!) in write performance when full, although not in read performance. (Tested this with an x25-m).

Sadly, recovering from a fragmented SSD on OSX right now involves opening the machine and booting linux. (I tried that, and it works: http://forums.macrumors.com/showthread.php?t=841182)


I'm not saying they don't degrade... just when they do, the performance is still so off-the-charts when compared to a hard drive that it's crazy to obsess over it.

And 10X sounds high to me - what sort of benchmark are you running? Most of the benchmarks I've seen put the hit at around 20 - 30% in random writes...


Back when I tried that I simply used xbench - the 4k block writes went below 10MB/s. I don't have the exact numbers, but I do remember that mac os took > 30 seconds of spinning wheel to boot, compared to 1-2 usually. BTW, filling the disk is as easy as performing "erase free space" with Disk Utility.


That doesn't seem typical - I'm using an 160GB X25-M G2 and have almost certainly filled the drive at this point (been running with less than 15% drive space free for a while, I leave hibernation on, installed and removed Boot Camp, etc.) and I'm still getting ~55 - 60MB/sec 4k sequential writes and ~60MB/sec 4KB random writes with the latest firmware in Xbench. I'd think booting would be mostly reads with a few writes here and there, too...


Although the 160GB has a slight write advantage over my 80GB G2, it appears those last 15% make quite a difference. That wouldn't be totally out of line from how regular HDs behave once they approach 100% utilized capacity. SSDs (the intel ones at least) have a buffer of cells that are inaccessible to the OS (that buffer is larger on e models), maybe that's double for the 160?


My X25-m died after 3 months of use, and I had the hd nearly full.. And I thought I would have never have to make backups again ;)


Most of the tweaks in the blog article have little to do with SSD. I seriously doubt any of the tweaks in the article will have any longer term effects on the actual usage of the SSD.


They are all pretty much designed to minimize the amount of writes to the SSD. This is more about extending the longevity of the SSD than anything else.


I'm guessing most users will upgrade their hard drives & laptops before you run out of write cycles on it. Silicon typically drops in price per gig faster than magnetic platter discs do...


You can indeed get a SSD in a Mac Air as an option. Does Apple treat those different in OSX? I'm not sure.

I replaced the mechanical harddisk in my MacMini with a SSD about a year ago. It broke down last week. I don't think OSX is to blame, since I put the same model SSD in my Windows and FreeBSD machines at the same time (the FreeBSD box is always on and pretty busy), and no problems there yet. Except for the 'noatime' I didn't take any special precautions.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: