I've been exploring these three recently in the desire to get the best possible performance out of a Raspberry Pi 3 Model B. I got it to boot directly from USB so the question I wanted to answer was whether I'd get better performance using a microSD card or USB flash drive. I had an unused SSD so I threw that into the mix as well.
The devices I tested are
- Sandisk 16GB Ultra Fit USB flash drive. https://www.sandisk.com/home/usb-flash/ultra-fit-usb This is hopefully a high quality and fast USB drive. (I have one in a Raspberry Pi 3B and another in a Chromebook without any apparent problems.) It's very low profile and unlikely to get in the way.
- Samsung 32GB USB 3.0 Flash Drive FIT https://www.samsung.com/us/computing/me ... f-32bb-am/ Another low profile USB flash drive.
- Samsung 32GB EVO Plus microSD Card http://www.samsung.com/uk/memory-storag ... -MC32DAEU/ One of the faster micro-SD cards I have tried.
- Crucial 512GB M550 M.2 SSD http://www.crucial.com/usa/en/storage-ssd-m550 (not NVME) previously used in one of my laptops.
- Install Raspbian Stretch (2017-07-05) to the media from a PC running Linux and using the 'cat' command. I purposely chose an older release so that the next two steps would have more packages to update/install. It turned out that this release requires 138 packages to make current. I also enabled WiFi and SSH for headless operation. Subsequent tests were performed by SSHing into the RPi and running the tests. A typical command and result for loading the image:
Code: Select all
root@yggdrasil:/home/hbarta/Downloads# time cat 2017-09-07-raspbian-stretch.img >/dev/mmcblk0 real 3m29.398s user 0m0.000s sys 0m3.004s root@yggdrasil:/home/hbarta/Downloads#
- Update available packages. A typical command and result would look like
Code: Select all
pi@raspberrypi:~ $ time sudo apt update Get:1 http://mirrordirector.raspbian.org/raspbian stretch InRelease [15.0 kB] Get:2 http://archive.raspberrypi.org/debian stretch InRelease [25.3 kB] Get:3 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages [11.7 MB] Get:4 http://archive.raspberrypi.org/debian stretch/main armhf Packages [127 kB] Get:5 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [27.7 kB] Get:6 http://mirrordirector.raspbian.org/raspbian stretch/non-free armhf Packages [95.2 kB] Fetched 11.9 MB in 18s (657 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 138 packages can be upgraded. Run 'apt list --upgradable' to see them. real 0m23.790s user 0m12.450s sys 0m1.370s pi@raspberrypi:~ $
- The last step was to time the update process
Code: Select all
pi@raspberrypi:~ $ time sudo apt -y upgrade Reading package lists... Done . . . Processing triggers for initramfs-tools (0.130) ... real 14m36.445s user 4m53.540s sys 1m6.350s pi@raspberrypi:~ $
(At this point I wish there is a decent way to format a table in a forum post but I'm unaware of a way to do that.) I'll do the best I can with character spacing and format as 'code' to get uniform character width.
I'm going to report elapsed time also as that's what is of interest to me.
Code: Select all
load update upgrade Sandisk 16GB USB 3m48.458s 0m23.790s 14m36.445s Samsung 32GB USB 3m12.206s 0m19.580s 18m37.994s Samsung 32GB SD 3m34.290 0m18.252s 11m50.542s Samsung SD (Eth) 0m18.360s 26m6.400s Crucial SSD 0m12.062s 0m21.576s 8m19.682s
SD vs. USB seems not to be a big difference. I was surprised that the SD actually performed the upgrade faster than both USB flash drives. The SSD is significantly faster.
Flash based devices get faster with bigger capacity as there are more chips to distribute operations over. That could easily explain the difference between 32 AND 16GB Devices. It also contributes to the speed in the SSD.
The Pi does not support USB 3. However USB 3 devices are faster and will more fully utilize the throughput available on a USB 2 connection. Unfortunately I have had poor luck using USB 3 hubs with the Raspberry Pi.
For the time being I'll continue to use the SSD with this Pi 3B (at least until I need it for another project.) In that situation I'll probably switch to the microSD card as it seemed to be a bit faster.
Another edit: Another question I have is which device will be most durable between SD and USB. The controller in the SSD employs wear leveling algorithms to distribute usage among the blocks so when the OS continually writes to the same location, the data actually goes to different physical locations in the disk. Some better SD and USB devices may do this too. I don't know if the devices I selected do this. Also the SD and USB devices are not designed for the kind of duty they would see as a system drive in a PC and (coupled with price pressure) dictates that less durable ICs will be used in their manufacture.
Time will tell.