You can view a video related to this blog post here: Does UASP make the Raspberry Pi faster?.
A couple weeks ago, I did some testing with my Raspberry Pi 4 and external USB SSD drives. I found a USB 3.0 SSD was ten times faster than the fastest microSD card I tested.
What's UASP, you might ask?
Without UASP, a drive is mounted as a Mass Storage Device using Bulk Only Transport (or BOT), a protocol that was designed for transferring files way back in the USB 'Full speed' days, when the fastest speed you could get was a whopping 12 Mbps!
With USB 3.0, the BOT protocol cripples throughput. USB 3.0 has 5 Gbps of bandwidth, which is 400x more than USB 1.1. The old BOT protocol would transfer data in large chunks, and each chunk of data had to be delivered in order, without regard for buffering or multiple bits of data being able to transfer in parallel.
So a new protocol was created, called 'USB Attached SCSI Protocol', or 'UASP'.
I won't get too technical here, but the SCSI protocol has been around for a very long time—long enough that it was part of a joke in this 1994 Dilbert comic. It has features like allowing parallel bits of data to be copied and out of order data transfer so the drive can use buffering and caching mechanisms for better performance.
Around the time USB 3.0 was introduced, most USB storage devices and adapters for hard drives started adopting the standard. And some computers with only USB 2.0 ports could have their firmware updated to use UASP for newer drives, so some USB 2.0 connections got a speed boost.
What does this have to do with the Pi?
Let's not get too far ahead of ourselves. Going back to Brad's comment on my Pi SSD video, I replied to Brad that I didn't even realize I had the non-UASP version of the Inateck case.
So I ordered the UASP version, and waited for it to arrive.
And when it did arrive, I tried to see what was different about it. The top, sides, and back are completely identical.
On the bottom, the only difference is one additional letter in the model number.
The differences are only really apparent if you take the thing apart and look at the actual circuit board. The older non-UASP version is on the top left in the picture above, and the UASP version on the bottom right. The UASP version has a completely different layout, and uses a different controller chip.
If you have a USB drive and don't want to take it apart and look up the specs of the controller chip, the only reliable way to tell if it's being mounted with UASP support or not is to plug it into your Pi, then run the command
$ lsusb -t /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=uas, 5000M
This command lists all the USB devices in a tree, and for each of the hard drives, you should see a
Driver listed. If it's
uas (like in the above example), then your drive supports UASP and you'll get the best speed. If it's
usb-storage, then it's using the older BOT protocol and you won't see the full potential.
I also had two other old SATA adapters that I've used over the years when doing computer repairs, when I would clone an old hard drive to a new one, or try to recover data from a hard drive in a broken computer.
I checked this inland adapter I bought from Micro Center, and it also supports UASP, which was a surprise since the specs on Micro Center's website showed the data transfer rate as "Up to 480Mbps", ha!
Then I checked this StarTech SATA adapter I bought in 2015 and it also supports UASP. So it looks like most newer USB 3.0 adapters do support it, but it's not always easy to see in the specs on Amazon or other retailers' websites.
Update: I also bought a cheap Sabrent adapter when it was on sale last week, and it also works with UASP on my Pi 4.
What about the Pi 3 B+ and older Pis?
Even though Raspberry Pis older than the Pi 4 only have USB 2.0 ports, I wanted to check if they might support UASP, because as we'll see in a minute, just having UASP versus the older BOT protocol makes a large difference in performance, which would help even on older USB 2.0 ports.
Alas, after testing with all my adapters, I found they all mounted the drive using the
usb-storage driver. I was trying to find any official confirmation as to whether the Pi 3 B+ firmware could support UASP, but all I could find was a reference in this Pi Forum post to the Pi's
dwc_otg driver not having support for a feature the UAS driver requires.
So if you have an older Raspberry Pi, your options for fast external storage are very limited. I'd stick with the Pi 4 if you want to do anything that requires data transfer like building a NAS, setting up Nextcloud, using it for backups, or media streaming.
Benchmarks with and without UASP
These benchmarks show just how big a difference UASP makes when you use it with a drive on a Raspberry Pi 4.
Across the board, UASP makes a huge difference. At the top there are benchmarks for hdparm and dd tests, which test large file transfers. These show 50% and 40% speedups, respectively.
At the bottom there are 4K random access benchmarks, which are a better measure of how the drive will perform doing typical computing tasks. And UASP still makes a big impact. Random reads are 35% faster, and random writes are 20% faster.
But I wanted to check something else, too. With more efficient data transfer possible, would there be any measurable difference in how much power is required?
For many Raspberry Pi projects, efficient power usage is an important consideration, especially if you're running the Pi off a battery or solar energy.
I used a Satechi USB-C power tester and measured an 8% peak power savings using UASP. That means you'd get 8% more runtime on a battery if you do a lot of file transfers.
As with all my benchmarks, I ran every benchmark four times, discarding the first result. I talked a lot about my benchmarking process in my previous Raspberry Pi Cluster video.
You can also see all the raw data and my methodology in this benchmarking issue on the turing-pi-cluster repository. If you run the same benchmarks, you may get slightly different results if you use a different SSD or enclosure.
My advice is always use UASP with USB 3.0 devices on the Pi 4, otherwise you're missing out on a pretty substantial performance gain. Also, remember to plug USB 3.0 devices into the blue USB 3.0 ports, not into the black USB 2.0 ports, otherwise you won't see any of the performance difference.