1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hardware Mac SSD performance and TRIM in OSX

Discussion in 'Article Discussion' started by Sifter3000, 1 Jul 2010.

  1. fprefect

    fprefect What's a Dremel?

    Joined:
    5 Jul 2010
    Posts:
    1
    Likes Received:
    0
    I'm not sure that zeroing the drive in Disk Tools effectively resets the cells like the TRIM command would. I expect you'd get the same results if you wrote 0xFF or random data to every sector and then performed your tests.
     
  2. Metatron

    Metatron What's a Dremel?

    Joined:
    5 Jul 2010
    Posts:
    1
    Likes Received:
    0
    Ditto on the post from davros. Flash erase state is all 1's eg a hex dump will show byte values of 'ff'. I think you are testing the clean case with a dirty drive.

    Also, his comment about doubting that writing all 1's will work is probably correct. In all likelyhood, the drive will keep a list of the blocks as have being written or not. It will use that table to decide whether to write or erase and write. Otherwise, it would need some logic to examine all the bits before deciding - which would be slow. Your strategy of writing the disk without the TRIM hardware/software will not touch the table so you are pretty much hooped.

    If you want to do a proper test, get a suitable TRIM equipped drive and use it on both the Windows and Mac platforms. That would be a valid test. What you have done is not.
     
  3. idontwannaknow

    idontwannaknow What's a Dremel?

    Joined:
    20 Feb 2009
    Posts:
    50
    Likes Received:
    2
    Here's what I'd like to see.

    Run above tests.
    Swap drives.
    Repeat tests.
     
  4. XKR

    XKR cow duo

    Joined:
    5 Jul 2010
    Posts:
    2
    Likes Received:
    0
    Your methodology is as good as you could. However, there are a great many steps between executing code an bits on disk, on a modern computer. Trying to compare two systems from “outside the box” is a bit like trying to compare to race cars, each of which has been optimized for body, chassis, suspension, engine, transmission, gas, tires, and track and driver by different people who did not talk to each other. They various parts, such as the file system and the SSD internal disk controller, could be working in harmony or working at complete cross purposes.

    Journaling will significantly affect performance. Are the MAC OS and the Windows 7 systems both journaled? As another commenter says, two disk drives that APPEAR the same may in fact have different firmware revisions that would make a BIG difference on aggressive performance tests. Another huge unknown are the two different benchmarks. As an engineer who used to design benchmarks, how the code is organized and compiled can make a HUGE difference in performance. Are operations pipelined? How many threads are used? The disk may not support command queueing, but the driver might. If the driver doesn’t, the file system might. If the file system doesn’t, the benchmark might.

    How about dynamic block re-assignment? This could be done, as with command queuing, at three different levels in the disk interface hierarchy.

    What are the native block sizes in the two OS’s?

    Running VMware Fusion on the Mac, then installing Windows 7 on the MAC would be an interesting comparison. You would then have the same SSD and same hardware interface. The main difference would be the file systems and the benchmark. You might have to ask vmware at what level they interface to the disk subsystem in the Mac.

    Love!
     
  5. phics

    phics What's a Dremel?

    Joined:
    5 Jul 2010
    Posts:
    1
    Likes Received:
    0
    As others have suggested, you can't write data through the SSD controller to properly wipe NAND chips. Rather, you need to 'secure erase' the drive through hardware. Pull the drive and do it from another machine if necessary.

    Your 'wiped' drive is probably behaving as if it's completely full, thus nullifying any tests after the fact.

    There should be some understanding of how SSD's work here... writing zeros to a 'disk' is not the same as wiping NAND chips in a Solid State Drive to make that space available for writing - which is ultimately what you need to accomplish.
     
  6. bofthew

    bofthew What's a Dremel?

    Joined:
    5 Jul 2010
    Posts:
    1
    Likes Received:
    0
    You guy's really compare the performance of an operating System that supports TRIM (Windows/Linux) with an OS that currently doesn't (OSX) on a SSD that _DOESN'T_SUPPORT_ TRIM in the first place ?
    Why did you actually publish this article ? How it is surprising that you measured no big differences in performance ?
    Do a valid test ! Don't just measure baseless values and publish them for the sake of it.
     
  7. makomk

    makomk What's a Dremel?

    Joined:
    5 Jul 2010
    Posts:
    1
    Likes Received:
    0
    Wrong: it's not the same thing at all. The program you used for the Windows 7 sends a command to the SSD telling it to erase all its data. As several people have pointed out, writing all zeroes to the disk has the opposite effect: it makes the SSD think the entire disk is in use. You're not going to get much performance degradation after that because the SSD will be close to maximum degradation already.
     
  8. frojoe

    frojoe What's a Dremel?

    Joined:
    17 Dec 2008
    Posts:
    135
    Likes Received:
    1
    This was a really interesting article, but it seems like one of those things that raised more questions then it answered. If you have the time to go back and do a more in depth look at this I think it would be a great read. I think using a macbook pro with an off the shelf ssd(with trim) would be best, and you could use bootcamp with win 7 to set the drive to a clean state, then go back to osx to do tests. Doing the tests on the same macbook pro in 7 and osx would be the best way to compare performance degradation between the two as the drive is written to and as the drive fills up. The exact speeds wouldn't be as important as the percentage of performance lost over time. I think the most important thing however is to use windows 7 to clear the drive to ensure the drive knows the space is free.

    edit: then again it seems apple may be getting ready to enable trim in osx, so pretty soon we may be asking for a comparison between the windows implementation of trim, and that of osx.

    -Joe-
     
  9. oceanwaves7

    oceanwaves7 What's a Dremel?

    Joined:
    6 Jul 2010
    Posts:
    7
    Likes Received:
    0
    I liked your first article that this one refers to. And this is nice, but the statement, "an OS that doesn't appear to be affected by SSD performance degradation" - I see this as sort of a flaw in this article, and is misleading, but saved by the fact that the last few paragraphs say that it will be looked into further. So I hope you do. But in saying that, your article is already being quoted as gospel in other articles that are proud of the misinformation. In fact, that's how I found this.

    But It's the hardware and the speed of that hardware that matter, not the OS. The slow down happens at the SSD cell level, not the OS level. Also file fragmentation doesn't result in noticeable slow downs on SSD because there is no physical head that has to move around anyway. At least not a 47% drop. that drop has far more to do with the SSD and how it handles it's data blocks.

    There's no doubt that SSD helps all types of computers, but you did tests on a slow macbook air... And while the good news is that those mac book air users may not need TRIM, however, the reason is because it doesn't have fast enough throughput to realize the peak potential of ab SSD's peak rate!! Especially a newer SSD. I'm sure if I get a 10 year old slow PC and hook it up to that SSD, that it will also have slow performance to begin with. Then after it gets "dirty", it will have the same results because the old machine can't get even close to peak performance anyway. So no wonder..

    In the PC you used, an intel i7 920 at 2.8ghz on X58 motherboard with appropriate memory, the SSD was the bottleneck after becoming dirty because the PC could easily keep up with the throughput. In the macbook air, I'm pretty sure the macbook became the bottleneck due to the fact that it's slow, outdated, core2duo tech, with a slower bus and other things.. I know we've been taught that a faster computer doesn't help hard drive transfers because they are slow to begin with, but SSD is changing all that. Throughput can be improved with faster, newer hardware. And every drive I've ever bought has been improved some when put in faster computers at least some, so an SSD even more so.

    But to complicate things, the SSD also wasn't a very fast one as you said. So maybe the mac could reach the potential of THAT SSD at 90MB/sec, but it still proved nothing since we don't know what happens on other faster SSD's. Or faster Macs for that matter. I think the right way to test it is to test it on a very fast mac. And because those are expensive, the cheapest way to do that might be to hackintosh. But from other suggestions here, running windows from boot camp is NOT a good idea because it's not truly running the way it would run if you formatted the HD and installed windows 7.

    And running windows 7 from vmware isnt' really the same as a normal pc either. The os won't run as fast. I also don't think you can run windows 7 from vmware and get it to TRIM the drive. Simply because then 7 is running from vmware on some simulated ntfs, under perhaps a journaled drive. And that's another problem. What file system you pick can have an effect too. But assuming 7 is running normally as it would on a PC, another problem pops up with whether or not the drive has trim, and if under 7 it will auto trim or not, and then knowing when it is "dirty" or not. But whatever you do, I think the correct way to test it is when you have a FAST SSD running on a FAST, modern motherboard. That way the computer can "out run" the SSD and has plenty of juice to show what it could have done.
     
  10. oceanwaves7

    oceanwaves7 What's a Dremel?

    Joined:
    6 Jul 2010
    Posts:
    7
    Likes Received:
    0
    Whew, major power failure here. Glad ot have power back.. But I wanted to add that where I say it's not the os that matters, I really meant for the most part, in this case, it's probably about the SSD at cell level. And also slow verses faster hardware will play more into it, but I also know that almost any little thing can make some small differences here or there. And other things I mention are trying to make good guesses as to what happened, but it's not easy to pinpoint anything exactly without having all the gear and time to test. Still I figure there's a logical explanation. It's one of those tests that look like a very easy thing to do, but then it always gets complicated after wards as you said, LOL. Again, your 1st article really drove home the point that shopping for an SSD with trim is a good idea. thanks.
     
  11. Yonzie

    Yonzie What's a Dremel?

    Joined:
    24 Dec 2003
    Posts:
    2
    Likes Received:
    0
    There's one very, very easy way to test this issue:
    Plug in an USB harddrive, install OS X on it, install Windows 7 in Boot Camp on the same drive.
    Then test the internal harddrive through both windows and OS X. Make sure you use TRIM on it between OS's.
     
  12. killmoms

    killmoms What's a Dremel?

    Joined:
    20 Oct 2010
    Posts:
    1
    Likes Received:
    0
    "But from other suggestions here, running windows from boot camp is NOT a good idea because it's not truly running the way it would run if you formatted the HD and installed windows 7."

    That is not true. Boot Camp is just a non-destructive disk-repartitioner that sets your Mac to boot from CD by default. That is literally all it is. Everything after that is normal and native when installing and running Windows.
     
  13. PascalT

    PascalT What's a Dremel?

    Joined:
    26 Oct 2010
    Posts:
    1
    Likes Received:
    0
    I have a totally different story here. Being the owner of a Mac Book Pro, I bought an OCZ Vertex 256Go drive, and I already saw the write performance drop twice from 80GB/s to an awful 8GB/s (twice in a 10 months period) !

    I have confess that I do abuse it, since this disk contains mainly a huge virtual machine (Win 7 with a disk filled up to 120GB disk) which I use intensively for compilations everyday... My virtual machine is powered by Parallels desktop.

    I'm wondering whether my disk is deficient since the drop is huge. However I do not think so, since I can restore the original performance by reformating / triming the disk. May be the fact that I am running a virtual machine is the cause. However I read in the comments that some did not have the same drop using VmWare virtual machine.

    Notes (hoping to help others) on how to restore the original performance :
    - As far as I tested the disk tester recondition method described at http://macperformanceguide.com/blog/2010/20100529_DiskTester--dlt-ssd.html was not helpful
    - You can plug the disk to an external PC (after having formatted it), and them trim it : it works
    - You can also boot under linux (from an live CD), and use the steps described at http://forums.macrumors.com/showthread.php?t=841182
    (a bit lenghty, but it does work)
     
  14. pubjoe

    pubjoe What's a Dremel?

    Joined:
    5 Nov 2010
    Posts:
    1
    Likes Received:
    0
    Sorry to be a smartarse, but for the sake of bit-techs credibility, this article needs to be removed.

    The facepalm moment was when you said: "the "Zero all data" option... takes the erasure process to the next level by converting all binary in the empty portion of the disk to zeros, a state that might be described as digitally blank." The next level? Count. Us. In.

    There are several wasted pages of degradation tests on flash memory, but you had already "dirtied" the memory by writing to every block when you prepared the ssd for testing - you did not test a "clean" drive at all. You then went on to write a completely misinformed article based on your failed results, by asking "does os x need trim?".

    As some readers have already tried to tell you in the comments, Secure Erase is not a low level format, it is a tool to overwrite sensitive data that could otherwise be retrieved from disk based storage. This is why it takes so long. And this is why you are given you the option to "zero all data" multiple times over.

    There is enough customer confusion and misinformation about flash memory behaviour as it is, without "technically authoritative" reviewers adding to it with farticles like this.

    I know I'm being overly condescending here, but people have already been kind when pointing out your error on the previous page and they seem to have been ignored. Also, it annoys me that I'm just a bloke who has tinkered with a few home computers in my spare time and yet I'm pointing out a fundamental flaw to paid journalists who are a self proclaimed technical authority.
     
  15. Endoxus

    Endoxus What's a Dremel?

    Joined:
    2 Aug 2004
    Posts:
    58
    Likes Received:
    0
    As the owner of a MacPro 2,1 with an Intel X25-M I have some experience with this.

    On the day of install the SSD had a sustained read of close to 250Mb/s and a sustained write of approximately 90Mb.

    I have noticed a performance degradation in the drive over the past 9 months, and My first though is that it was a TRIM related issue. I will report back with a bench test of the current drive, which has been used daily since January.
     
  16. ka9q

    ka9q What's a Dremel?

    Joined:
    6 Dec 2010
    Posts:
    1
    Likes Received:
    0
    I concur with the other commenters who point out that writing zeroes into a SSD page is not the same thing as asking the drive to erase the page.

    There seems to be a lot of confusion about just what TRIM does and why it's needed.

    The basic problem is that without it, the drive has no way to know which pages contain valid user data and which *used* to contain valid data that has since been deleted and made available for reuse. The drive doesn't understand (and can't be expected to understand) the file system's internal data structures, like its free list.

    Ordinary hard drives don't care because you can overwrite any block with new data. But a SSD page has to be erased before it can be overwritten. And erasing is slow.

    TRIM helps performance in two ways. By erasing pages as soon as they're freed, TRIM helps the drive keep an inventory of blank pages that can be quickly written with new data. But that's not the real reason it's such a win. SSD pages are typically 4kiB each, but they can only be erased in contiguous blocks of 128 pages (512 kiB). Before a block can be erased, all of the pages that are still valid have to be copied elsewhere. And without TRIM, once every page has been written at least once the drive thinks EVERY page in the block other than the one about to be overwritten is a valid page that has to be copied -- even if they're actually on the file system's free list!

    This is why write performance can slow to a crawl without TRIM - every 4k page write can easily turn into a copy of 127 other pages plus an erase! This pathological situation is known as "write amplification". With TRIM, the file system can tell the drive which pages no longer contain valid data so that when fresh pages are needed for new data, the drive can pick the block containing the fewest valid pages, copy only those pages elsewhere, and erase the block.

    I can conceive of alternatives to TRIM that would have the file system batch up all writes into blocks of 128 contiguous pages (one SSD block) so that the drive could do a single erase and overwrite operation, but I don't know if any real drives can do this. But TRIM is definitely the better solution, as a drive that knows which pages contain real user data can always do better than one that doesn't know.
     
  17. ghislain

    ghislain What's a Dremel?

    Joined:
    29 Dec 2010
    Posts:
    1
    Likes Received:
    0
    To the best of my knowledge, filling a drive with zero is just another way to write data on that disk, it does not revert the drive to factory state. The only way to achieve that is to use SSD Secure Erase under gparted. This is probably the reason why bench on clean and dirty drive were just the same...
     
  18. orencom

    orencom What's a Dremel?

    Joined:
    22 Feb 2011
    Posts:
    1
    Likes Received:
    0
    I've been going over this long thread briefly and I'm not sure if there are any open questions left
    If so feel free to ask, I can provide you with all the answer about SSDs, TRIM etc.
    Couple of remarks:
    Mac OS X doesn't support TRIM (yet)
    writing 0 or 1 or any other data pattern won't bring the SSD to a factory state.
    secure erase ATA command is the best way to restore the SSD to its factory state however this method wont be easy for the average user to perform. easiest way would be attaching the SSD to Windows 7 machine and format the SSD (create NTFS partition and quick format it) by doing that Windows 7 will send set of TRIM commands covering the entire LBA space and bringing the SSD to its factory state.
     
  19. kikan

    kikan What's a Dremel?

    Joined:
    29 Mar 2011
    Posts:
    1
    Likes Received:
    0
    Hi Guys,

    Thought I'd get back to this thread to post the link below as it is now possible to enable trim under Mac OSX :

    http://www.yellow-bricks.com/2011/03/28/enable-trim-on-os-x-10-6-7/

    Of course, it is not supported, at your own risk etc... etc... Seems that not all disk will benefit from this so you might want to do some reading first.

    Regards.
     
Tags: Add Tags

Share This Page