This is a good point, but there is a larger problem anytime you are relying on SD cards for a R/W root partition. Especially when making a product out of one of these boards. It's so easy to follow a tutorial and start an idea from a Bone or Pi or whatever and have some cool functionality and think it's ready to sell. Unfortunately, many of these boards don't have on board flash and by default are booting from SD card with a Linux distribution. It will fail a lot more than a real hard drive does. A cheap SD card is not the same as an SSD when you get down to it, no way around it. Absolutely use the SD card to log data, but don't make booting dependent on cheap removable flash media. Choose an SBC that has high quality flash with good EEC. Source: Experience datalogging with SBCs for 3 companies for 10 years of my career.
I'm curious about the quality of the uSD card holders on all of these units. Do they all use quality non-corrosive fingers with enough force on the contacts?
I once had an intern that told me all about his RPi project to do model rocket telemetry, then after some interrogation sheepishly admitted that the project never quite worked because the g forces and vibration at launch were enough to make the card holder lose contact and the kernel panicked. Bummer.
I think a simpler and easier solution when you have plenty of memory is to use an initramfs [0] as your root, which avoids having to read from disk after boot. Considering the Pi 4 can be had with up to eight gigs of memory now, this is a pretty good solution. Additionally, Buildroot [1] can build a kernel with a compressed initramfs image quickly and easily, for a number of popular single board computers, including the entire Pi family. This allows more than enough functionality for simple and reliable data logging.
EDIT: You couldn't be sure when the disk was ready for writes, so you'd have to log to memory, and have a task that attempts to mount the data partition and flush the buffered data to disk atomically before clearing the buffer.
I've got a rocket flight computer I develop d during covid and one of the top things people say about designing these is to add a flash chip to it. The ad card is great to store data and transfer it to a computer but during flight? No way can you rely on the contacts. So during flight, you save all the data to flash, then once landed, dump it to the SD card. SD card got loose? Beep in a special pattern and keep trying to connect to it, I come along , hear the pattern and hold the SD card in until it stops beeping and emits a "happy" sound letting me know it all transferred.
Rockets are difficult environments for connectors, the spring loaded compliant mechanism of an sd card holder just isn’t appropriate for that application. You could get it to work but it would involve a lot of vibration analysis and design to be gentle enough to the connector and you would have to keep track of every time a card was connected and removed.
Newer PIs can boot from the network, in case you need to put new code on because the current code doesn't boot... and you could use the network to fetch data as well. Maybe not as convenient, maybe more convenient, depending.
I wonder if you could fix this with some extra casing around the card slot to make it friction fit. Or an even filthier hack - hot glue/solder it in place, and use a wifi enabled micro sd so you can still access it when the rocket comes back down (and reuse your stuck together sd card monstrosity on multiple launches) .
Hi! I'm the guy that tested these and I hear you, as I mentioned at the bottom of the post, I'm currently working on stress testing some of the cards through a series of sequential read/write and random IO tests and as soon as I have enough data to justify the post, I shall be putting it up. I don't have a Samsung endurance card, though I'm testing a SanDisk MAX ENDURANCE card in this round.
I am very interested in this as well. Could even help us with endurance info for other sized cards (like regular SD, etc) if they are using the same chip manufacturer inside!
I'm not sure if you're offering to purchase some to have their results added? You really don't have to, but I've created a list to help me keep track of which cards I don't have and wouldn't mind testing at https://www.amazon.se/hz/wishlist/ls/7JG01YVBN93M - I'll add other brands later but this is a good way to keep track of things and monitor prices anyway!
If it was you that purchased the 3 then thank you so much! I should be able to get those and the others I had arrive in the last week added over the weekend. I'll post an update here (if I don't get banned for it? :D) as this will be another 500+ benchmark runs over another 10 cards.
I'll call it a day on performance testing at that point and put a group of them to the test endurance wise then!
I've seen failure rates of >5% / year on 24/7 read-only Pi deployments across a variety of name brand consumer microSD cards. Are you getting better reliability than that? What cards have you deployed the most of?
We have a lot (upper hundreds) of the Canvas Go! Plus cards from Kingston. I'll see if I can get some more details. Basically any UHS 3 or better card our supplier can provide. A little over 300 of the Samsung EVO Plus cards.
Logs were written to a ram fs. We experimented with occasionally flushing logs to disk, but ended up disabling this and leaving the microSD card filesystem read-only 100% of the time.
The main problem with running a Pi on a microSD card isn't write endurance, it's low quality controller and firmware implementations on the cards.
Contributing factors include:
- Even when used read-only, the flash memory occasionally needs to be refreshed, which means the controller needs to shuffle data.
- Controllers have to map drive addresses to flash, and they store their tables on the flash. Firmware bugs, power interruptions, or problems with the flash can render the tables unreadable and lose all data.
- Some controllers even store their firmware on the same flash that is used for user data. So problems there can brick the card.
I don't know if its true or not... but I feel like I lose data when I leave my phone in the car.
Temperature-changes almost certainly changes the physics of the microsd cards. I feel like what's reliable at room-temperature (70F) may not be reliable at 32F or 140F.
Then again, Rasp. Pi setups probably don't care about temperature. But I can imagine cameras, phones, etc. etc. that are left in a car in a wide variety of temperatures who may care.
That's pretty bad. I've had 3-5+ years (still running) on most of the sdcards in my 5 Pis. There was one exception with a Sony card that only lasted 1+ years, but the other cards have been fine. I periodically take backups for restoratio/creating clones.
We use a Supercapacitor UPS hat to supply enough power for a controlled shutdown due to concerns over SD card corruption (you get around 1 minute). It's been reliable on systems that regularly lose power over a period of around 5 years. The hat we use (Juice4Halt) is more expensive than the SBC though, so that is probably a non-starter for a lot of people.
As the other guy pointed out, I'm doing this in my spare time with hardware I had or was able to procure quickly/at a decent price (this isn't sponsored, sadly!) I don't have many Samsung cards at this time but I'm looking into my options. I already have 4 cards that I'm almost finished with speed testing (SanDisk MAX ENDURANCE, Integra Ultima PRO, Patriot EP and a Kodak model) and will source more as and when I'm able to :)
I know USB booting on pi is still not perfect, but it almost seems to make more sense at this point to boot off of a decent USB flash drive, I would think? If you get a decent brand with good benchmarks, I would think that reads/writes would blow all SD cards away. What I'm not sure about is latency or lifespan, though I would think _good_ USB flash drives are likely to be better quality flash than SD, without really being significantly costly in comparison?
I say this as someone that uses SD cards currently, and I understand if others do also- it's the easiest/default option, but I've definitely given thought to switching
USB flash drives are mostly just as bad. Many advertise large read/write numbers but they overwhelmingly all hit a wall once the MB or two of cache is full. And they seem to be as unreliable as SD these days.
The solution is USB->SATA SSD converters with SATA SSDs. Those will easily sustain a few hundred MB/sec read/write. The problem then becomes the USB inefficiencies, but for the most part wear leveling/etc make them pretty bullet proof.
The PFTF UEFI firmware will reliably boot off just about everything you can plug in (USB DVD/etc included).
I've had a USB flash drive failed after only 3 months in the Raspberry Pi before, so now I'm using a SATA-USB cable with a SSD drive, looking good so far.
I have a weird wish that someone would test all these SD cards for their latency while an crossing allocation unit boundary in SPI mode. This is quite different than average latency.
One work project of mine involved a bunch of sensors, an 8-bit microcontroller without much memory, and an SD card. It turns out that cost, brand name, and speed class have nothing to do with AU boundary latency. Trying to write 255 bytes every 2 to 10 milliseconds at a few MHz on a chip with 2.5 KB SRAM, the limiting factor is the SD controller needing up to a hundred milliseconds every 10 seconds or so (depending on AU size) during which real-time data cannot be buffered in the SD card, microcontroller, or sensor FIFO. There's simply too much data waiting to store!
-----
A few notes for anyone at all who cares:
Single-level cell (aka industrial) SD didn't result in a faster AU change speed.
One SD card---out of 10 or 12 tried---would not pull down its MISO line unless an extra clock pulse was manually bit-banged, which is a really stupid behavior to debug after having a few working cards. Tracking down this bug took a lot of garbled data, scope measurements, and re-readings of the SD specification to see if my code was wrong or the card manufacturer was non-compliant.
The specification has a maximum write latency of something like 200 ms, and that's the sort of detail you miss until you've spent time and money designing/ordering a PCB and realizing you should've just added a 64Mbit flash IC and dealt with the inconvenience of UART data transfer.
I use 1TB SanDisk (Raspberry 2) and 4GB Panasonic SLC (Raspberry 4) in my distributed database cluster: http://github.com/tinspin/rupy
In my experience industrial versions of mainstream cards are less reliable!
I agree, you have to measure latency and longevity on these edge (maximum longevity or space) SD cards as bandwidth is limited by SPI (4 is not really that much faster than 2).
USB3 is not stable enough for 99.9999 uptime.
If you use the cards above and mostly write once on the 1TB and replicate all that data on 3 cards in 2 geographical locations in realtime (6x in total minimum = you have redundancy even if one node fails on local and global level) you should be fine.
After having 8GB Odroid MMC fail on me twice after 5 years, I invested in Intel Atom servers with X25-E (65nm SLC 100.000 writes per bit) drives as backup plan if the SD card solution fails/has problems.
Power goes from 2W to 25W (50W with 10x SATA SSDs) with that change so you cannot afford more than 1-2 Atoms per location as lead-acid backup will be too expensive/large otherwise.
Remember, if you do not power flash memory for a long time the data is corrupted/lost. You need your disks to be powerable on solar/wind, in practice this means Raspberry 2 when the mains go.
As electricity prices rise the supply quality will degrade. Power outages will increase exponentially until the powergrid fails without replacement parts/transport.
Peak energy is not a speculation, it's the only sure thing.
I really dislike how the only the biggest number from each category is bolded. I really doubt that 5 tests was enough to make 21.21MB/s significantly (statistically speaking) faster than 21.16MB/s.
Other than that, I'm really surprised by just how much faster the IO on the RPi4 is. Quite the difference!
Having data bars like in excel[1] solves this issue. The ability to easily visualize any difference is a nice bonus as well. For instance 2.16 MB/s vs 2.55 MB/s is statistically significant, but it's probably not something that you'll notice in regular use unless you have a stopwatch. However 2.65 MB/s vs 4.49 MB/s is easily noticeable.
Thanks for your comment. I'm not sure if just leaving them as is and letting the reader decide how they want to interpret/read the results would be better? I'm doing these mainly out of my own curiosity in my endless free time at the moment and I'm new to creating content like this so I'm open to feedback!
My thought too. Appreciate the authors effort; but given how tight all the numbers are along with the 5 tests, if I were the experimenter I'd feel like this was a big waste of my time and inconclusive.
No need to worry, I often feel like what I'm doing is a waste of time. I do agree with what someone else said though as I feel like whilst the sequential reads and writes on most boards are largely the same, the random reads/writes are a little more varied and this may be what people are looking for. In either case, if a £5 card performs largely the same as a £15 card, I'd say it was worth doing for the money savings. Whether that £5 card will last as long as the £15 one is a different matter but hopefully with some of the other tests I'm doing, we'll find out!
As a reader, I found this more interesting as an IO benchmark of various SBCs. While it may not have been the first benchmark of its kind, I don't really seek out that information, so this was interesting to me at least.
This is great data! I sliced it 2 different ways in Google Sheets -- by SD card and by Raspberry Pi board.
Agreed that Amazon Basics is the surprising front-runner for the cards, although the IOPing results are shockingly bad for most cards except SanDisk Ultra 16 + 32. Might need to use Analytical Hierarchy Process to determine how each performance characteristic should be weighted.
For boards, the top 3 in your tests by a wide margin are:
1) Orange Pi i96,
2) BeagleBone Black (2GB eMMC),
3) Raspberry Pi 4 Model B (Revision 1.1 – 2GB)
The same place I found the Raspberry Pi 1/Model B? In my cupboard :D I didn't go out and purchase everything brand new for this post. I used what I had available to me! I often see these 2GB models pop up on our local version of eBay and they're out there. Does the newer version have a different SD card reader or other hardware that will render the results pointless in a comparison with it? (Genuine question!)
The BBB Rev B BOM lists a Micron chip that tops out at 30MB/s read and 6.6MB/s write (pretty close to measured).
The BBB Rev C BOM lists Micron chips in that range but also lists chips like the Kingston EMMC04G-M627 which is capable of 250MB/s read and 25 MB/s write.
eMMC sure, but I only added that as a comparison as it was there. This was mainly targeted at the SD card side of things. This post was to show the performance of microSD cards in these specific SBCs, it wasn't a test of the eMMC.
I have to wonder how lucky the Amazon card is: is the manufacturer consistent, or is it just a rebrand of whoever has made them a deal this quarter? Or several rebrands?
This is actually part of my worry too and I bought 2 units (of the 2x64GB) from the UK and Swedish sites and both are showing up as the same manufacturer etc. Would definitely like to hear from others that have them though to see how consistent things are over in North America.
I had a Kingston SATA SSD that failed. It didn't just become read-only, it failed completely and catastrophically. One day everything was there, the next day the drive couldn't access anything.
I delved deeper after that and now stick to major manufacturers.
I started that testing around a week ago! Will hopefully have enough data for a post in the coming weeks but it's a bit easier to test for speed first and before you kill cards :D
My understanding is that the SD card standard is often the bottleneck here. It would be nice if devices (like the Pi) could move to the faster UFS standard.
Some, but I'm not sure Linux supports it yet. I had also seen some patches for turning on the DDR SD mode, again not sure if they're used today though.
Would be interesting to see a write torture test until failure comparing the samsung "PRO ENDURANCE" microsd cards to regular u1/u3 class cards.