Lead Image © Lucy Baldwin, 123RF.com

Lead Image © Lucy Baldwin, 123RF.com

Finding the fastest SD cards for the Raspberry Pi

Speed Racer

Article from ADMIN 76/2023
By
Testing single-board computer storage.

A few issues back, I examined the infamous label soup that is printed on modern SD cards, exploring the meaning of those arcane runes and the standards they represent [1]. The most common variants of performance speed found in stores today is summed up in Table 1 [2] in order of increasing speed, ranging from the now dated C10 (speed class 10) to the newest A2 (application performance 2). SD cards are advertised on maximum throughput – meaning sequential I/O. This choice is perfectly sensible given their primary application area is to store pictures and video. For computing, however, random I/O is a much more interesting metric.

Table 1

Common SD Card Storage Speeds

Label Rating Speed
C2 Speed class 2 At least 2MBps of read/write speed
C10 Speed class 10 At least 10MBps of read/write speed
UHS 1 Ultrahigh speed class 1 At least 10MBps (same as C10)
UHS 3 Ultrahigh speed class 3 At least 30MBps (same as V30)
V10 Video speed class 10 At least 10MBps (same as C10)
V60 Video speed class 60 At least 60MBps
V90 Video speed class 90 At least 90MBps
A1 Application performance class 1 At least 1,500 4K random read, 500 write IOPSAt least 10MBps sustained sequential write
A2 Application performance class 2 At least 4,000 4K random read, 2,000 write IOPSAt least 10MBps sustained sequential write

As SD cards careen toward ever faster speeds, it is important to remember that performance is achieved by the combination of the reader in the host and the memory card. Bus speeds are not the same as speed classes, and some of the newest classes rely on additional hardware; for example, the UHS-II, UHS-III, and SD Express standards have the ability to provide even faster speeds than UHS-I by using two lanes for data transfer on two rows of pins.

Similarly, full-duplex and half-duplex modes are now available [3]. Also, don't forget that faster options are available when SD cards are not sufficient. The Raspberry Pi 4 model B incorporates a USB controller. Although not capable of the full 625MBps of the standard, it can handily reach over 340MBps with any half-decent external SSD drive.

Lies and Benchmarks

It is said that, in life, there are only lies, damn lies, and benchmarks. That is especially true when vendors are involved, but the adage is always worth remembering to highlight the one-dimensional nature of benchmarks. They don't answer the question of what is "fastest" across all dimensions of "fast," only one specific line of inquiry per number, at best. That said, I'll bench test some cards. Jeff Geerling of Ansible fame used to run an annual SD performance comparison for use on single-board computers (SBCs) [4]. Jeff moved on from the practice a few years back, so I thought it might be fun to run my own tests in 2023.

The testing platform is the all-in-one Raspberry Pi 400 (Figure 1), a custom board redesign (for cooling reasons) of the Raspberry Pi 4 in the once popular "computer in a keyboard" form factor of days past. Board layout aside, it can be thought of as a Raspberry Pi 4 SBC with 4GB of RAM, WiFi access, and some additional layout changes to expose the GPIO connector at the back of the keyboard.

Figure 1: The modern take on the in-keyboard computer: the Raspberry Pi 400.

Jeff has set up a really convenient script on the benchmarking section of his site [5], which you can pull down and execute with a one-liner. To reduce the amount of typing required, I aliased the original path [6]:

curl -L https://tinyurl.com/5f5rkn9p | sudo bash

I am running the same 32-bit Raspberry Pi OS image on all SD cards tested (Figure 2), in a stock default configuration, only setting up network and running updates before testing. The details of the actual benchmarks and their purpose is examined in the "Individual Tests" box, but first, look at the results!

Individual Tests

Sequential reads is a measurement of raw throughput without help from the Linux caches (unbuffered) and is remarkably consistent across all modern cards tested. Run with the hdparm [7] tool as:

sudo hdparm -t /dev/mmcblk0

Sequential writes is a large continuous write, forcing filesystem sync to ignore caching effects. Run with the dd [8] tool as:

sudo dd if=/dev/zero of=/home/pi/test bs=8k count=50k conv=fsync;   sudo rm -f /home/pi/test

Random reads and random writes are 4K random I/O operations at the heart of a filesystem in general compute use. The random write portion was historically problematic for low-end SD cards. Run as

iozone -e -I -a -s 100M -r 4k -i 0 -i 1 -i 2 [-f /path/to/file]

with the iozone [9] benchmark.

Figure 2: SD cards of various sources to feed the benchmarks. Note the bold 130MBps claim on the brand name unit!

Run Like the Wind

The first card tested, a SanDisk Edge model, performed admirably well, closer to the A2 standard than its stated A1 rating, falling short just a few IOPS from the higher rating (Figure 3). This was the card model with which the Raspberry Pi Foundation's own store equipped early Pi 400 orders, so it could stake a claim to the official baseline for this device.

Figure 3: Results of the benchmark runs for five microSD cards.

Next up, the Samsung Evo posted impressive results, exceeding the requirements for an A2 card yet also modestly only claiming A1 performance, while doubling the sequential write performance of the previous entry. Matching the 130 MBps claim on the packaging required using an external USB 3.0 reader, and performed at 126.46 MBps in sequential read tests (results did not change in the write test). As performance results from a combination of reader and card, perhaps this unit is using newer standard capabilities the Pi's card reader does not yet supply to achieve its high throughput claim – like using multiple I/O lanes.

The next two models were generic Micro Center units, offering really good performance at a cheaper price. The comparison highlights the bigger card's A2 rating and outsize write performance, but to be clear, even the cheaper A1 card will boot Linux just fine (Figures 4 and 5). Interestingly, the 64GB card repeatedly fell just short of its claimed V30 write throughput rating, yet it simultaneously beat all other cards in random I/O reads (one should expect at least a 10% variability in SD card IOPS figures). The Micro Center 128GB was really the champion of this little test, repeatedly and consistently posting an outstanding random 4K write IOPS.

Figure 4: MicroSD card benchmark throughput results. Note the 2X variation of write performance.
Figure 5: MicroSD card benchmark random I/O results. 4K random write is the critical metric for SBC use.

The final entry was a recent purchase of a low-spec card from Micro Center, with listed specs that may have been in use a few years back. Its high performance shows it was clearly made with recent silicon, exceeding historical performance for a C10 but badged to a lower specification to streamline production lines.

Everyone Wins

Until recently, the only way to be sure of an SD card's performance as an SBC mass storage device was to order one and run benchmarks on it yourself. Today multiple websites exist [5] [10] [11] to collect and share standardized results, making it rather effortless to validate performance before purchasing a card. One thing stands out above all: Although some cards have markedly better performance than others, perhaps the one reason Jeff stopped publishing benchmarks annually is that all of the cards tested are now adequate to run an SBC with a Linux distribution. With significant range in the 4K random write IOPS test results, all cards tested performed admirably compared with the performance landscape just a few years back [12].

The Author

Federico Lucifredi (@0xf2) is the Product Management Director for Ceph Storage at IBM and Red Hat, formerly the Ubuntu Server Product Manager at Canonical, and the Linux "Systems Management Czar" at SUSE. He enjoys arcane hardware issues and shell-scripting mysteries and takes his McFlurry shaken, not stirred. You can read more from him in the new O'Reilly title AWS System Administration .

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=