Sunday, July 16, 2017

linux - diagnose and improve external hard drive performance


I have an external hard drive (Western Digital Red 3 TB, WDC WD30EFRX-68EUZN0) in a USB enclosure. Both the drive and the enclosure support SATA at 6 Gbit/s, and the enclosure is connected via USB super-speed (5000 Mbit/s). I'm copying files using rsync from my internal hard drive (Western Digital Red 6TB, WDC WD60EFRX-68L), and am getting a transfer speed of around 30 MB/s (240 Mbit/s?).



  • To me this sounds slow, considering SATA 6 / USB-SS support about 20 times that much?


  • If it is slow, what can I do to diagnose the problem and improve the speed?





Some additional information in response to @Ale..chenski: The enclosure has the name "Renkforce" printed on it. I think that is an "off-brand", belonging to the local semi-professional IT retailer where I bought it (Conrad.com).


lsusb identifies it as


JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge

so the chip is "JMS567", but I don't know whether that's good or not. At least it confirms that the bridge is supposed to deliver up to 6Gb/s.


The USB connector on the enclosure is labeled "USB 3.0" and it and the included cable are colored blue, which is the code for USB 3.0. So unless they are committing fraud, it quite clearly is a USB 3 device.


On the computer side it is connected to a blue USB outlet labeled "USB 3.0 / UASB" and the super-speed logo. KDE's KInfoCenter shows it as connected to an xHCI Host Controller with a speed of up to 5000 Mbit/s.


Answer



You're focusing on the theoretical maximum transfer speed, 6Gbit/s or about 750MB/s. I don't know about that particular hard drive, but I don't think physical spinning hard drives can approach anywhere near 6Gbit/second. It seems like 200MB/s would be a high average.


It can be hard to know if you've got a slow or fast drive, but comparing it to other identical drives should give you an idea. For your particular drive Amazon says 145MB/s is a typical transfer speed (not counting the buffer, and with no USB enclosure & overhead in the way).


Try some HD speed tests, to test & eliminate seek times - copying a particular file that happens to be fragmented, or just spread around the drive (I think some filesystems write files in "stripes", ext seems to).


Disks / gnome-disk-utility has some nice benchmarks for disks (or partitions) that should completely ignore filesystem & file quirks, journaling, partition alignment, etc.


enter image description here


Askubuntu has a question How to check hard disk performance with more details/ideas. hdparm -Tt [device] looks good too.


There's not much you can do to speed up your computer's USB. Try unplugging every other USB device and test again, or ensure you use fast hubs.


If you can remove the hard drive from it's USB enclosure, you could connect it directly to your computer via SATA, then test it's speed without the USB being "in the way."


If the speed is now within the average 145MB/s, then you know the USB enclosure is slowing the drive down, and if you want the best speed then don't use the USB enclosure, just directly connect the hard drive to your computer's SATA (or consider a hot swap hard drive bay).


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...