The performance of an operating system (os) of a Raspberry Pi is notably affected by the type and details of the storage media where it resides. Micro sd cards are commonly used on many pi models, and the RPi3 has the added capability of booting from a usb-connected drive with some additional os setup and modification.
While trying to figure out which cards I should purchase for a couple of new Pis, I realized (again, painfully) the opaque nature of technology in the modern age, and how leveraged we are to that. It took a lot of time to try and find specs on the different cards; the manufacturers have nothing readily available on the internet, at least at a sufficient level of detail. Then it took more time to sort thru the myriad of forum posts and benchmarking results of the community, and discern the nuances of different tools, systems, and configurations. The Raspberry Pi and other forums have tons of posts on this and other issues related to micro sd cards; it requires lots of reading, very little of which seems relevant. And, such is life in the modern age; the devil is still in the details.
However, a couple notable benchmarking efforts of micro sd cards can be found online. Raspberry Pi Dramble has a great review of results of several cards along with the details of his benchmarking process. David Lechner recently conducted a similar set of trials with various cards. Both studies used iozone to benchmark sd cards with a Pi3.
Some of the newer cards claim to be compatible with the A1 standard. As I understand it, these cards are designed to be used with mobile devices, and are more responsive to reading/writing smaller files. The A1 standard describes a minimum of 1500 iops for 4K random reads and 500 iops for 4K random writes, which roughly means the card should be able to read small files at 6 mb/s and write at 2 mb/s. I was interested to see if A1 rated cards really were faster in benchmarking tests on a Pi, relative to their non-A1 predecessors. I also wanted to see how micro sd cards compare with usb flash drives, which seem to have noticeably longer boot times on a Pi3.
I decided to use the iozone application and benchmark my current stable of cards and flash drives. Pi Dramble has a nice description of how to download and use it. Results are tabulated below along with some comparisons from the work of others.
card/drive | model | size | A1 | vendor | 4K rand read | 4K rand write | source |
---|---|---|---|---|---|---|---|
Adata Premier | AUSDH32GUICL10A1-RA1 | 32 gb | yes | Newegg | 6.72 | 3.39 | 4 |
Sandisk Extreme | SDSQXAF-032G-GN6MA | 32 gb | yes | Amazon | 8.59 | 4.43 | 3 |
Sandisk Extreme | unknown | 16 gb | no (?) | unknown | 9.44 | 2.42 | 1 |
Sandisk Extreme | unknown | 16 gb | no (?) | unknown | 8.22 | 2.39 | 2 |
Sandisk Ultra | SDSQUAR-032G-GN6MA | 32 gb | yes | Amazon | 7.22 | 2.52 | 3 |
Sandisk Ultra | unknown | 16 gb | no (?) | unknown | 5.32 | 1.52 | 1 |
Samsung Evo+ | MB-MC32DA/AM | 32 gb | no | Amazon | 8.24 | 3.04 | 3 |
Samsung Evo+ | MB-MC32DA/AM (?) | 32 gb | no | unknown | 9.66 | 3.43 | 1 |
Samsung Evo+ | MB-MC32GA/AM | 32 gb | no | Best Buy | 4.32 | 0.66 | 3 |
Samsung Evo+ | MB-MC32GA/AM (?) | 32 gb | no | unknown | 4.45 | 0.78 | 2 |
Sandisk Ultra Fit | SDCZ43-128G-GAM46 | 128 gb | no | Amazon | 3.20 | 2.31 | 3 |
Samsung Fit | MUF-32BB/AM | 32 gb | no | Newegg | 3.31 | 0.57 | 3 |
Sources:
1) Pi Dramble, results for Raspberry Pi model 3 B
2) David Lechner, results for Raspberry Pi 3 benchmark
3) my own benchmarking results; Raspbian Jessie
4) my own benchmarking results; Raspbian Stretch; added 17 Oct 2018
The A1 cards I tested do seem to have improved performance, both in the benchmark results and in the time it takes for the Pi to boot. The flash drives also differed in their performance from one another, and generally didn’t perform as well as the cards.
I would also like to point out that manufacturers can change their cards from year to year, and that a card’s model number might be a better description than its model name. The Samsung Evo+ cards are a perfect example. The newer cards (2017) are much much slower for 4K random read/write than the older ones (2016). The two models become marginally similar in performance for 512K random read/write, and perform equally with large files.
The Raspbian repository includes a benchmarking utility called Fio, which I also used with the cards and dives. The variation seems higher for this tool as compared with iozone, though I didn’t quantify that for either application. But Fio seems capable of discerning major differences in random reads/writes of the various cards. It also reports results in iops. Fio requires a ton of flags; I used the following terminal command:
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=100M --readwrite=randrw --rwmixread=75
card/drive | model | size | A1 | vendor | read, mb/s | read, iops | write, mb/s | write, iops |
---|---|---|---|---|---|---|---|---|
Adata Premier | AUSDH32GUICL10A1-RA1 | 32 gb | yes | Newegg | 4.9 | 1231 | 1.6 | 409 |
Sandisk Extreme | SDSQXAF-032G-GN6MA | 32 gb | yes | Amazon | 5.4 | 1356 | 1.8 | 453 |
Sandisk Ultra | SDSQUAR-032G-GN6MA | 32 gb | yes | Amazon | 4.5 | 1123 | 1.5 | 382 |
Samsung Evo+ | MB-MC32DA/AM | 32 gb | no | Amazon | 3.9 | 977 | 1.3 | 326 |
Samsung Evo+ | MB-MC32GA/AM | 32 gb | no | Best Buy store | 1.0 | 258 | 0.35 | 86 |
Sandisk Ultra Fit | SDCZ43-128G-GAM46 | 128 gb | no | Amazon | 2.35 | 586 | 0.80 | 196 |
Samsung Fit | MUF-32BB/AM | 32 gb | no | Newegg | 1.28 | 319 | 0.44 | 106 |
As a final thought, the speed of an sd card is not likely related to is durability with something like a Pi. Again, the RPi forums are bloated with posts about this topic. And again, after much reading, its difficult to divorce the durability of the card from other issues, namely the voltage and/or stability of the power supply and the relative size of the card. So anecdotally, my 32gb Evo+ (MB-MC32DA/AM) has been running Boinc projects constantly for over a year with a 5.25V supply from Adafruit, with no corruption or other issues after several power failures. The PowerJive is a great tool for measuring the supply voltage and current draw for a Pi, though mostly because it has micro-usb input port. And in case you were wondering, my Adafruit adapter does indeed supply 5.25V to the Pi. Nice.