Test performance of a variety of microSD cards on Raspberry Pi - sequential and random read/write #7
Comments
|
Just for comparison, doing the same |
Transcend 300x card on Raspberry Pi 2Using the same Transcend 300x card as with the B+, I re-ran all the tests on a new Raspberry Pi 2 model B:
|
SanDisk Extreme Pro 8GB card on Raspberry Pi 2Prep instructions:
|
SanDisk Extreme 16GB card on Raspberry Pi 2
|
Samsung 16GB EVO card on Raspberry Pi 2
|
|
...and here are some rather depressing read/write stats (depressing because they show how much faster a proper USB 3.0 bus is for these fancy cards) from my MacBook Air using a USB 3.0 microSD card reader: SanDisk Extreme Pro 8GB SanDisk Extreme 16GB SanDisk Ultra 16GB Samsung EVO 16GB Transcend Premium 300x 32GB Kingston Class 10 8GB Cheapo Class 4 4 GB |
|
I've compiled these benchmarks here: https://github.com/geerlingguy/raspberry-pi-dramble/wiki/microSD-Card-Benchmarks |
|
I've also added some info about external USB drives here: https://github.com/geerlingguy/raspberry-pi-dramble/wiki/External-USB-drives |
|
If you really want to test flash memory performance, you need to use |
I have an old 64GB USB 3.0 SSD I pulled from an old MacBook Air, and it gets 150-300MB/sec transfer, with quite low latency. It would definitely saturate the USB 2.0 bus on the Pi, but it might be a heck of a lot faster as the data store for MySQL than using the normal mount inside the cheap Kingston microSD card!
It's worth investigating at least, and maybe in the database playbook, the configuration could allow for internal vs. external drive configuration.
Format a USB-connected drive on the Raspberry Pi in Raspbian
$ sudo fdisk -lfdiskto edit the disk's partition table:$ sudo fdisk /dev/sda1*d,n,p,1,<enter>,<enter>,w$ sudo mkfs -t ext4 /dev/sda1*/ssd) and mount the partition:$ sudo mount /dev/sda1 /ssd$ sudo nano /etc/fstabSee this post for more tips.
We're assuming the device is
sda1. It could be something else, depending on your system's configuration/hardware.Test the raw read/write speed of the disk with
hdparmandddInstall
hdparmfirst, with$ sudo apt-get install -y hdparm.Read speed, SSD:
Read speed, internal microSD (Kingston Class 10):
Read speed, internal microSD (SanDisk Ultra Class 10):
Read speed, internal microSD (Transcend Premium 300x 32GB):
Read speed, internal microSD (Cheapo Class 4 4GB):
Write speed, SSD:
Write speed, internal microSD (Kingston Class 10):
Write speed, internal microSD (SanDisk Ultra Class 10):
Write speed, internal microSD (Transcend Premium 300x 32GB):
Write speed, internal microSD (Cheap Class 4 4GB):
...looks like I need to do some more benchmarking and see whether the internal microSD card can hold its own against a fast SSD over USB 2.0! Maybe the Pi 2 is even better than the Pi in terms of latency/sustained speed for the directly-connected microSD slot?
Test random I/O and other things with
iozoneInstall
iozoneon the Raspberry Pi$ wget http://www.iozone.org/src/current/iozone3_430.tar$ cat iozone3_430.tar | tar -x$ cd iozone3_430/src/current$ make linux-arm./iozone -e -I -a -s 100M -r 4k -r 512k -r 16M -i 0 -i 1 -i 2Test results
Internal Kingston 8GB microSD
Internal SanDisk Ultra 16GB microSD
Internal Transcend Premium 300x 32GB microSD
Internal Cheapo Class4 4GB microSD
External USB 3.0 64GB SSD
Further notes on
iozoneusagethe unmount option is used. When testing with unmount between tests it is necessary for
the temporary file under test to be in a directory that can be unmounted. It is not possible
to unmount the current working directory as the process Iozone is running in this directory."
Comparison with 2013 MacBook Air
This is just to demonstrate the incredibly wide gap between a modest modern workstation's I/O capabilities and the Raspberry Pi (for anyone who believes that optimizing a Raspberry Pi for modern high performance computing applications is potentially worth the effort for anything besides education and fun).
Write speed, internal SSD (PCIe):
Write speed, external SSD (USB 3.0):
Internal SSD (PCIe):
External SSD (USB 3.0):
External old-fashioned 2TB spinning disk (USB 3.0):
(To build iozone on Mac OS X, I had to run
make macosxinstead ofmake linux-armin step 4 above).The text was updated successfully, but these errors were encountered: