UPDATE: The 2022 storage benchmarks are now available!
After publishing my Raspberry Pi Minecraft Server tutorial I got some feedback on Reddit to try using a USB SSD for storage. I expected some marginal improvement but nothing spectacular due to the USB 2.0 bus data rates. In fact the results were so spectacular that I’m changing my storage recommendations entirely. Let the games begin!
- Samsung Evo 32GB MicroSD*
- Samsung Evo+ 32GB MicroSD*
- Samsung Pro Plus 32GB MicroSD*
- SanDisk Ultra 64GB MicroSD*
- EMTEC 64GB MicroSD*
- SanDisk Cruzer Glide 16GB Flash Drive*
- SanDisk Extreme 64GB Flash Drive*
- Hynix mSATA 128GB Solid State Drive*
- Crucial 2.5″ MX Series SATA Solid State Drive*
Each drive was imaged with Raspbian Lite and booted up once and a sudo apt-get update && sudo apt-get upgrade was issued. After a reboot the testing began. The mSATA solid state drive uses a USB 3.0 adapter to create a really cool flash drive (see my article here on how to make one). The Crucial solid state drive uses a 2.5″ SATA to USB 3.0 adapter*.
The Raspberry Pi 4* was set to boot from USB mode so the entire operating system was running on the solid state drives just like the mSATA drives to provide a fair playing field.
The most important factor performance wise for a card running an operating system is small random read/writes. The operating system is constantly reading/writing these. The dd test measures raw throughput and represents what performance you’d see transferring a large file. Some storage devices have very high throughput but poor 4k read/writes which indicates a poor medium to use as a card for your Raspian operating system.
Alright, on to the testing!
Benchmarking / Testing Storage
If you want to verify your drive’s performance you may want to run my storage benchmark with:
sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash
If you search for the model of your drive on Pi Benchmarks you can compare your score with others and make sure the drive is performing correctly!
|Contender||dd test||4k random read||4k random write||4k read||4k write||4k rewrite|
|Samsung Evo+||7.3 MB/s||4768||761||4914||613||1117|
|SanDisk Ultra||13.6 MB/s||9247||2686||9558||2324||2895|
|Samsung Evo||16.6 MB/s||10297||3329||10345||1495||3230|
|Samsung Pro Plus||23.5 MB/s||10189||2115||10247||2460||2985|
|SanDisk Cruzer USB||4.7 MB/s||3989||1116||10170||2026||1969|
|SanDisk Extreme USB||16.1 MB/s||7339||9077||11491||9732||10291|
|Hynix mSATA SSD USB||35.5 MB/s||9231||11401||11489||10996||11473|
|Crucial 2.5″ SATA SSD USB||35.1 MB/s||10167||11419||11081||10412||11443|
The cheap MicroSD cards performed about as poorly as expected. If you are running one of the generic cheap MicroSD cards in your Pi you are *really* slowing it down. The difference from a generic EMTEC to a Samsung Pro Plus is staggering. The raw dd throughput is 280% faster but the 4k random writes are 1000% faster on the Pro Plus! You really do get what you pay for with a MicroSD card.
Now on to the flash drives. The SanDisk Cruzer USB Flash drive is only a few bucks. It performed predictably poorly. Even mid range MicroSD cards beat it in every category and it was dead last in the dd test. However don’t write off USB flash drives yet, because the SanDisk Extreme 64GB *crushed* it in 4k random writes. Although the raw dd test throughput lost to the Samsung Pro Plus it is 233% faster when it comes to random writes. None of the MicroSD cards come even close. Conclusion? If you use a very good USB flash drive you will outperform MicroSD cards fairly easily as there are much faster drives out there than the SanDisk Extreme I used in my test.
Now let’s talk about the final category and the true winner here: SSDs. It’s not even close folks. These drives are maxing the bus. They have no weaknesses in any category and are faster than the most premium of all other storage mediums. The two SSDs tested are not the same speeds. They are just so fast that they are faster than the USB 2.0 bus can handle and it maxes out somewhere around 35MB/sec. We are talking a 540% gain in 4k writes over the Samsung Pro Plus (not at all a cheap card).
The big takeaway here is that YES, they are worth using over MicroSD cards and flash drives. On average you are getting at least 4x the random 4k write speed by using a solid state drive with your Raspberry Pi than the most premium of MicroSD cards can provide. Unless you need your Pi to fit somewhere small and can’t fit a USB-based storage medium into your project, solid state storage is the best choice and clear winner!
do you have any newer replacements for the SSDs or the USB drives?
In relation to the Crucial 2.5″ MX Series SATA Solid State Drive and the Sabrent USB 3.0 to SSD / 2.5-Inch SATA Hard Drive Adapter. Did that run fine directly connected to the RPi (i.e. no USB hub, extra power)?
It does! The Sabrent adapter provides the power directly over USB without using a USB hub or any external adapters other than the normal one for the Pi.
I’ve been working on getting a minecraft sever up and running on an asus tinker board and your tutorial has been a huge help. Thanks for all your efforts!
I’ve got the latest paper sever working but it could use just a bit more pep, I’m thinking the storage is the bottleneck. I’m using a Sandsik Ultra SD card but I was thinking that a USB flash drive might be the best choice after reading your findings.
Would you recommend I flash the OS off the flash drive and run my tinkerboard off it? Or would the sever work fine if I just migrated the sever folder to the flash drive? I’m still new to these Linux micro computers, so any advice on that would be a great help!
Either method should provide a substantial improvement. Most of the storage bottlenecks are IO waiting to be read/written to the disk.
If you have a fast disk like a solid state drive I’d recommend flashing the OS to it as well.
Running the disk storage benchmarks like the Dramble benchmark should give you an idea of how fast your USB storage is. It is located here
Great stuff man! I was utilizing what you wrote here and went to implement an SSD with my R.pi 3B+ but I’m having troubles getting it to boot from the SSD.
Did you run into any common errors? I know I setup the USB Boot correctly because it will boot from a flashed Flash Drive, but just not an SSD.
I tested on two different ones, a Kingston A400 and a PNY CS900 both with the same effect.
I have a similar USB 3.0 to SATA cable, and I’m seeing the R.Pi go through the boot cycle because it powers the SSD for 2 seconds but then no dice!
I’d be interested to hear if you ran into any problems with an SSD installation.
When I did my tests I did have to change the /boot/cmdline.txt options before it would boot. This can vary from different drives and USB adapters. There is any easy way to show what it will mount as though and change the lines.
Here is a good walkthrough.
I did not check the timings yet.
All I can tell is that the worst part is exploring (with horse). Probably because it load a lot of chunks.
For information, the mods I use are : Botania and thaumcraft
I confirm, it’s better with an SSD, it is smoother (we are only 2 on the server).
The mods I use need Forge, so I will stick with this configuration for now (until a new raspberry comes out !).
Thanks for your reply !
Thanks for the follow up post!
Sounds like a good plan. The SSD will make a big difference. I’d also check out your timings as they should work on plugins as well and you may be able to determine which mods are the most expensive. Sometimes there are configurations that can help with resource usage if you identify which is the slowest and what it is slowing down on.
Hello, did you try Minecraft with an ssd ?
I have follow your previous tutorial to set up a minecraft server with a raspberry 3b+, and it works very well (thank you !!).
But then I have installed forge + some mods, and the performance are not really amazing. It’s playable, but there is some latency (I use a samsung 32go microsd class 1).
I’m going to use the timings tool to see the weaknesses.
I am not sure an ssd will be better, the main limitation is probably the ram.
I agree that the RAM is likely limiting you. Forge is a good framework but it is going to add some RAM usage. I’d see if you could find some equivalent Spigot/Bukkit plugins which use the framework that is already in this server and will spare you a lot of RAM usage. A good place to start: Spigot/Bukkit plugins