OSX, bootcamp on ext. USB3, native boot: USB performance

This is for discussing general topics about how to use VirtualBox.
Post Reply
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

OSX, bootcamp on ext. USB3, native boot: USB performance

Post by socratis »

Hey everyone, I'm trying to figure out something that I can't seem to (logically at least). Here's the setup:
  • MacBookPro retina (mid-2015, model 11,5) running OSX 10.11.6.
  • External USB3 HD, NTFS formatted, into which I installed Windows 10 [1]. EFI mode was required for that.
  • Hard drive can boot the MBPr externally and the Mac runs Windows 10 just fine (unavoidable, necessary evil, please don't accuse me of treason ;) ).
  • Hard drive can also be accessed via the "rawdisk" option and run as a VM in OSX with VirtualBox 5.2.0. With the GAs installed and everything working great [2].
  • Finally, the HD can be accessed as a plain old ext. HD. OSXFuse with NTFS-3g used, with no write caching.
But, (there had to be a "but"), I'm getting really varying (terrible) hard disk transfer speeds, which differ a lot for me to explain, that's why I'm trying to see if I'm missing something fundamental. Here are the transfer speeds for copying a large (7.6 GB) file to the USB3 HD:
OSX to USB3 mounted as a disk (Finder) ........ : 680 Mb/s <-- That's more than USB 2.
Win10 booting natively, file duplication ...... : 360 Mb/s <-- Unacceptable.
OSX to USB3 mounted as a disk (cp) ............ : 240 Mb/s <-- Finder vs. 'cp': What???
Win10 as a VM, guest from VBox shared folder .. : 120 Mb/s
Win10 as a VM, internal copy .................. :  55 Mb/s <-- Has to go through the host twice.
Win10 as a VM, guest from SMB network share ... :  40 Mb/s <-- ??????
So, if I simply mount the NTFS formatted USB3 ext. HD, I get the maximum of 85 MB/s (=680 Mb/s), which proves that I can have more than USB2 speeds (max. theor. 480 Mb/s). Not the theoretical 5120 Mb/s (just a 13.3% of that), but at least it's something.

On the other hand, if I boot from the ext. HD to a native Win10 environment, the speeds drop really, really low to 360 Mb/s. And I refer to really low as in compared to the 5120 Mb/s. Even with half that I'd be happy, but not at a measly 7% performance.

At the beginning I thought that it might be something to do with how the natively boot Win10 sees the USB port (or it is presented to it by the MBPr ). Maybe it sees it / it is presented as a USB2 one. That's a potential thing to consider, but alas, all the signs in Win10 show that it is recognized as a USB3 HD on a USB3 port. Nothing else connected BTW, straight to the source. Oh, and I tried both ports on the MBPr.

Of course I can gather any information that might be suitable, I simply didn't want to flood the post with too much information. I'll start with some basics and if anyone has any need to see something more, feel free to ask...

[1]: I can provide the details (sweat, blood and tears) that this required, but not on this post, it's going to be too long. Just ask. And yes, it does involve VirtualBox...

[2]: Do NOT install the Win10 updates while running the whole setup in a VM. It's an old known bug (#1633). And it's a pain to recover from that...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Martin
Volunteer
Posts: 2560
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: OSX, bootcamp on ext. USB3, native boot: USB performance

Post by Martin »

Are you sure that the different numbers between the Finder, Win10 and cp are not "just" differences in caching?
What is the hardware type of the disk, what can it really transfer? The interface speed is not really relevant if the rotating disk is just slow.
Did you always use the same set of test data and start with an empty cache state?
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: OSX, bootcamp on ext. USB3, native boot: USB performance

Post by socratis »

Martin wrote:Are you sure that the different numbers between the Finder, Win10 and cp are not "just" differences in caching?
Tested 3 times, between reboots. But, I will reboot, get a fresh start and try again. Who knows, maybe Mars is close to Saturn?
Martin wrote:What is the hardware type of the disk, what can it really transfer?
Well, the maximum that I got up to are not really USB3 speeds, but I was getting a steady 680 Mb/s repeatedly. Just in one case.
Martin wrote:Did you always use the same set of test data and start with an empty cache state?
Yes. That's my puzzle. As I mentioned I've tried everything under the book. Since I stopped using Win since Win2K, I might be missing something. :?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: OSX, bootcamp on ext. USB3, native boot: USB performance

Post by socratis »

PS. I tried a big large file just to make sure that "cache" was not involved...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: OSX, bootcamp on ext. USB3, native boot: USB performance

Post by michaln »

I usually use 'dd' to measure device read speed, but there are caveats too -- a lot depends on how big blocks are read. That could well be the difference between Finder and 'cp'. If any caching is involved then that of course influences the numbers a lot. Doing 'dd' on Windows is hard, on OS X it's easier, but there are caveats too.

Let me see if I can find my notes... on Linux 'sudo dd if=/dev/sdb of=/dev/null iflag=direct bs=64k' works well (you hit Ctrl-C after a few seconds, it tells you how much and how fast it transferred), /dev/sdb needs to be replaced with the actual drive and the 'bs' (block size) can be set to 1M for example; the block size will affect the results. The 'direct' flag bypasses any cache. On OS X it's not as straightforward though.

And you should only use reads to get the sense of the interface speed, because writes are often far slower than reads (especially true for flash storage). If there's anything funny like a disk using 4K sectors but presenting 512-byte sectors to the world, that will have an impact.

Another potential factor is UASP vs. standard MSD protocol, although I doubt that would make real difference for linear reads/writes.

In Windows, you should check the Device Manager and see how the drive is attached, also check what driver is used for the MSD, is it USBSTOR.SYS or something else? Finding the USB interface speed needs 3rd party tools, although 'VBoxManage list usbhost' should tell you. On OS X, System Information will tell you the actual interface speed.

If I understood it correctly, none of the cases involve the USB passthrough in VirtualBox, right? It's the host OS always managing the drive.

It might be worthwhile to try Linux on the system. 85 MB/s (680 Mbps) may well be the limit of a not-super-fast rotating disk; it will get nowhere near 5Gbps, you can just forget that.

From my own experience I know that for USB3 sticks (i.e. flash) the performance vastly varies, the read speed could be 70 MB/s or it could be 200MB/s (that's megabytes), and for writes there's even more variability.
Post Reply