taylorkh
Posts: 106
Joined: Mon Nov 20, 2017 7:57 pm

SD Card speed - Pi limitation ?

Fri Jan 25, 2019 2:20 pm

I have done some searching on the "best" MicroSD cards for the Pi. I already have several cards and they all work except for one which I think was defective from the factory and is going back to Sandisk when their support phones wake up later today. That said, while diagnosing the bad card I decided to do some benchmarking of card performance. The results are a bit strange which will bring me to my question. Allow me to explain...

I am using the gnome-disks tool - not the best tool perhaps but I have it handy and for card to card comparison it should do the trick. In order to remove other variables I decided to test the cards in the card slot in one of my Pi 3b+ machines. I launched Raspbian from a USB flash drive, installed the gnome-disk-tools package. I inserted the card to be tested in the card slot and ran the benchmark within gnome-disks.

A class 4 card, which I do not use in the Pi's gave a read/write score of 23.1/4.1 MB/s
Two PNY cards - 11.9/10.8
Another PNY - same model - 23/5.6
A Sandisk card - 23.7/12.4

The PNY cards are advertised "up to" 80 MB/s and the Sandisk "up to" 100 MB/s. Which brings me to my question (finally)...

What is the read/write speed capability of the card slot on a Pi 3B+? If in fact it is less than 25 MB/s then a high speed 100 MB/s card would seem to be wasted.

TIA,

Ken

User avatar
DarkPlatinum
Posts: 868
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: Website YouTube

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 2:25 pm

I can't really answer your question but I can give reasons why to buy more expensive SD cards:

1. Reliability. "Ultra" cards usually are more reliable.
2. "Ultra" cards are made for high performance. These are made to work with cameras which record 1080p at high framerate or 4K video. These would work well with a pi.
3. More expensive cards usually have better wear leveling techniques. Hence the card should last for longer under normal use.
4. More expensive SD cards have gotten cheaper. You can buy a Sandisk Ultra 64GB from amazon.co.uk for 12 pounds when on sale. (currently a sale on)
Last edited by DarkPlatinum on Fri Jan 25, 2019 2:27 pm, edited 1 time in total.
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): https://html.dynu.net

jahboater
Posts: 5927
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 2:26 pm

Have you looked at the A1 and A2 class cards?
https://www.sdcard.org/developers/overv ... index.html

These are much more suitable for running an OS from because the random I/O performance is optimized.
4000 IOPS random 4k reads.

https://www.amazon.co.uk/SanDisk-Extrem ... me+plus+a2

Claimed "up to" 170 MB/s probably helps too.

The larger cards are faster, I buy the 128GB size now.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2415
Joined: Thu Jul 11, 2013 2:37 pm

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 2:27 pm

The overall "bus" speed of the SD card slot is approx. 23MB/s read or write. With the root filesystem on an SD card, the critical parameter for performance isn't sequential read or write speed (which is what many of these basic testers give you numbers for) but random 4k read/write performance. Random 4k read tests more closely approximate the workload that you get when e.g. booting the OS and related to this is the random 4k write performance - some cards will slow reads down significantly if you intersperse occasional random writes.

The SD cards that we supply preformatted with NOOBS are optimised for random read/write performance - typically 1.5MB/s random write, ~6MB/s random read. Dedicated performance testers like bonnie++ or Crystaldiskmark can test these access partterns.
Rockets are loud.
https://astro-pi.org

fruitoftheloom
Posts: 23838
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 2:35 pm

taylorkh wrote:
Fri Jan 25, 2019 2:20 pm
I have done some searching on the "best" MicroSD cards for the Pi. I already have several cards and they all work except for one which I think was defective from the factory and is going back to Sandisk when their support phones wake up later today. That said, while diagnosing the bad card I decided to do some benchmarking of card performance. The results are a bit strange which will bring me to my question. Allow me to explain...

I am using the gnome-disks tool - not the best tool perhaps but I have it handy and for card to card comparison it should do the trick. In order to remove other variables I decided to test the cards in the card slot in one of my Pi 3b+ machines. I launched Raspbian from a USB flash drive, installed the gnome-disk-tools package. I inserted the card to be tested in the card slot and ran the benchmark within gnome-disks.

A class 4 card, which I do not use in the Pi's gave a read/write score of 23.1/4.1 MB/s
Two PNY cards - 11.9/10.8
Another PNY - same model - 23/5.6
A Sandisk card - 23.7/12.4

The PNY cards are advertised "up to" 80 MB/s and the Sandisk "up to" 100 MB/s. Which brings me to my question (finally)...

What is the read/write speed capability of the card slot on a Pi 3B+? If in fact it is less than 25 MB/s then a high speed 100 MB/s card would seem to be wasted.

TIA,

Ken

https://www.jeffgeerling.com/blog/2018/ ... rison-2018
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot) RaspiOS64 ARM64
Asus ChromeBox 3 Celeron is my other computer...

User avatar
DarkPlatinum
Posts: 868
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: Website YouTube

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 2:49 pm

jdb wrote:
Fri Jan 25, 2019 2:27 pm
The overall "bus" speed of the SD card slot is approx. 23MB/s read or write.
What about using an external SSD? Is it still 23MB/s or is it up to the USB Hub bus speed?
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): https://html.dynu.net

chwe
Posts: 159
Joined: Tue Jul 31, 2018 1:35 pm

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 2:51 pm

http://www.iozone.org/ also available for arm.. ;)

jdb wrote:
Fri Jan 25, 2019 2:27 pm
The SD cards that we supply preformatted with NOOBS are optimised for random read/write performance - typically 1.5MB/s random write, ~6MB/s random read. Dedicated performance testers like bonnie++ or Crystaldiskmark can test these access partterns.
well.. in the days of A1 rated cards for a small budget I would never go for something else than those..
Not measured on a RPi but roughly with the same sloppy SDIO interface:

https://www.raspberrypi.org/forums/view ... 1#p1409591

There's not much to compere in those days.. Only one major SD-card player brings affordable consumer-grade SD-Cards with A1 specs.. you buy it you test it and if it doesn't provide near to A1 performance you return it cause it's a fake card.

User avatar
rpdom
Posts: 17418
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 3:20 pm

DarkPlatinum wrote:
Fri Jan 25, 2019 2:49 pm
jdb wrote:
Fri Jan 25, 2019 2:27 pm
The overall "bus" speed of the SD card slot is approx. 23MB/s read or write.
What about using an external SSD? Is it still 23MB/s or is it up to the USB Hub bus speed?
It's up to the USB speed as it has nothing to do with the SD card interface.

User avatar
HawaiianPi
Posts: 5953
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 3:45 pm

The Pi computers do not support any of the high speed SD standards (U1, U2, etc.), but you can overlock the SD card slot for a little better performance.

Standard SD cards, even "fast" Class-10 cards are highly optimized for sequential read/write, but an OS drive does lots of non-sequential I/O, and most SD cards are bad at random I/O (REALLY bad)! Curiously, many of the Class-10 cards are the worst (some older Class-6 cards beat them).

The newer "A1" rated micro SD cards will provide a noticeable improvement in performance. I've been using SanDisk Ultra A1 cards for awhile now, and I've been happy with them. The A1 rating specifies a minimum of 1500 IOPS (my 32GB SanDisk Ultra A1 card tested at 2500 in the built-in slot on my gaming laptop), while I believe the A2 rating is 4000.

Of course if you really want high IOPS get an SSD. The raw throughput of the SSD will be bottlenecked by the USB 2.0 interface on the Pi, but the high IOPS will further improve performance. I have a couple of Pi3 computers USB booting from SSD. USB booting is slower, but once up and running the SSD is faster. That being said, the difference isn't going to be dramatic, so for systems with modest storage needs I still recommend A1 rated micro SD cards. The price of those cards climbs rapidly in larger sizes, though, so SSD makes sense if you need 128GB or more.

The tricky part of USB booting an SSD is finding a USB-SATA adapter cable or enclosure that is compatible, and that's much harder than it should be if you want to boot with no micro SD card (a little easier if you don't mind starting the boot process from SD and running the OS from USB).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
DarkPlatinum
Posts: 868
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: Website YouTube

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 4:04 pm

rpdom wrote:
Fri Jan 25, 2019 3:20 pm
DarkPlatinum wrote:
Fri Jan 25, 2019 2:49 pm
jdb wrote:
Fri Jan 25, 2019 2:27 pm
The overall "bus" speed of the SD card slot is approx. 23MB/s read or write.
What about using an external SSD? Is it still 23MB/s or is it up to the USB Hub bus speed?
It's up to the USB speed as it has nothing to do with the SD card interface.
So my SD card would perform better if Instead, I booted the Raspberry Pi with an SD card, but the SD card is in USB SD card reader?
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): https://html.dynu.net

chwe
Posts: 159
Joined: Tue Jul 31, 2018 1:35 pm

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 4:19 pm

DarkPlatinum wrote:
Fri Jan 25, 2019 4:04 pm
rpdom wrote:
Fri Jan 25, 2019 3:20 pm
DarkPlatinum wrote:
Fri Jan 25, 2019 2:49 pm


What about using an external SSD? Is it still 23MB/s or is it up to the USB Hub bus speed?
It's up to the USB speed as it has nothing to do with the SD card interface.
So my SD card would perform better if Instead, I booted the Raspberry Pi with an SD card, but the SD card is in USB SD card reader?
why? cause USB2 is 40MB/s whereas the SDIO is 23MB/s.. read the rest of all the answers here and you'll hopefully get it that this doesn't matter..

User avatar
DarkPlatinum
Posts: 868
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: Website YouTube

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 6:09 pm

chwe wrote:
Fri Jan 25, 2019 4:19 pm
why? cause USB2 is 40MB/s whereas the SDIO is 23MB/s..
Im talking about general use, not random 4k read/write. The USB bus is >200mbps so should easily accommodate the 100mbps SD card.
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): https://html.dynu.net

chwe
Posts: 159
Joined: Tue Jul 31, 2018 1:35 pm

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 6:53 pm

general use involves random 4k/16k... drivers get called, logs get written etc. the USB, which the RPi has only one, which is shared between all USB ports and network limits your 400mbit/s quite soon.. whereas the SDIO interface for SD-Cards is independent.. IMO the only two reasons to attach USB storage is its better durability or a lot of storage is needed (e.g. SD card flash controllers are rather dump/limited whereas a reliable SSDs has more advanced flash controllers but then I would also go for an SBC which actually can use that speed - something with USB3/SATA/NVMe, otherwise it's IMO just a waste of money...)

and if you want to compare, install iozone and compare yourself ;) (something like 16MB files will be close to max. seq. write speed when benchmarking)
Last edited by chwe on Fri Jan 25, 2019 7:38 pm, edited 1 time in total.

User avatar
rpdom
Posts: 17418
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 7:06 pm

chwe wrote:
Fri Jan 25, 2019 6:53 pm
it's IMO just a waste of money...
If you think that, why do post on this forum?

chwe
Posts: 159
Joined: Tue Jul 31, 2018 1:35 pm

Re: SD Card speed - Pi limitation ?

Fri Jan 25, 2019 7:20 pm

it's a waste of money to connect a fast SSD to a RPi which only has a shared USB2 port.. Didn't say it's a waste of money to buy a Pi and boot it with a SD-Card... If you spend >100$ for a reliable fast SSD then there are better SBCs to use it.. they cost (mostly) a bit more but there are a bunch of <100$ SBCs which have real GbE and one of the mentioned interfaces above to get something out of your SSD...

The RPi isn't champion when it comes to fast interfaces.... It shines for other use-cases. but that's all off-topic here..

User avatar
HawaiianPi
Posts: 5953
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: SD Card speed - Pi limitation ?

Sat Jan 26, 2019 3:16 am

DarkPlatinum wrote:
Fri Jan 25, 2019 4:04 pm
So my SD card would perform better if Instead, I booted the Raspberry Pi with an SD card, but the SD card is in USB SD card reader?
For sequential I/O the answer would likely be yes, but OS performance benefits more from good random performance, and the USB card adapter can have large influence on performance. When testing several card readers I own, I found that my SanDisk Ultra A1 card ranged from 1500 to 2500 IOPS, but the adapter with the highest IOPS was not the fastest at sequential I/O. This is a major YMMV caveat.

Regardless, USB booting will always be slower, and any performance improvements will only be seen after the OS is up and running.

chwe wrote:
Fri Jan 25, 2019 7:20 pm
it's a waste of money to connect a fast SSD to a RPi which only has a shared USB2 port...
Depends on capacity. Large A1/A2 rated micro SD cards get expensive, and at 256GB+ capacity an SSD may actually be cheaper. So for projects that need a lot of storage, SSD can perform better and save money. An SSD is also a more robust device that is less likely to fail or corrupt data.

Of course the tricky part is finding a USB adapter or enclosure that's compatible with Pi USB boot...
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

taylorkh
Posts: 106
Joined: Mon Nov 20, 2017 7:57 pm

Re: SD Card speed - Pi limitation ?

Sat Jan 26, 2019 2:35 pm

Thanks to all who have responded to my post. WOW! A lot of good information and links. I now know more about SD cards than I really wanted to :)

My 3 - 16 GB Sandisk cards are marked A1. They provided good performance. My 3 - 16 GB PNY brand are not so marked but they work OK. That said, the biggest problem I have with the Raspberry Pi computer is that it finds its way into a "production" use before I have enough play time :mrgreen: My original Pi 3B became the gateway, firewall, router, VPN sharing box for my LAN. It replaced a small Intel based PC.

So I purchased a 3B+ as a toy. Before long it was dedicated as a BitTorrent client. It has a 240 GB Crucial M500 SSD connected with a StarTech USB to SATA adapter cable. (I have a couple of those adapters. They work great but the Pi still boots from the MicroSD card).

And I purchased another 3B+ which last weekend it became the jukebox for my workshop. It is attached with Velcro to the back of an old 15" LCD monitor. It has a dongle for a wireless mouse and a 32 GB flash drive with my 450+ album music collection converted to mp3 files. A low privilege user account automatically logs on, starts Caja pointing to the flash drive and the Audacious music player. I can navigate it with the mouse alone, no keyboard required.

And I purchased another 3B+. So far this one has escaped being assigned to a permanent job :lol:

All of my "production" Pi's are running in "server" roles. Once they are booted they tend to stay up unless I take them down for maintenance or similar. They do not need to do much IO to the MicroSD card so the card speed is not a concern. My "play" Pi is running from one of the A1 Sandisk cards so I guess I have optimized the usage of my "best" cards.

I think my newest Pi is safe for a while. Last evening my neighbor brought over literally a pickup truck load of OLD PCs which his boss had told him to get rid of! My neighbor wants to learn about Linux and I told him I would go through the junk pile and see what might be useful to set up a little training environment. Talk about old crap - I threw away newer items 10 years ago. I did find a Core2 Duo based machine which seems to run Ubuntu rather well. Now if I can find another machine to configure as a play server... Anyone want some scrap metal? Free for the pickup. Perhaps I should give the Smithsonian museum a call :idea:

Thanks again,

Ken

p.s. Sandisk customer service determined that the troublesome 64 GB MicroSD card which stated all this was a counterfeit. Ebay refunded my money and I have reported the phony item to them. I do not know if the seller was intentionally selling these things or if they had gotten into the supply chain before he got a hold of them.

chwe
Posts: 159
Joined: Tue Jul 31, 2018 1:35 pm

Re: SD Card speed - Pi limitation ?

Sat Jan 26, 2019 2:43 pm

just saw the first 400gb SanDisk A1 for 90$ in a local store (if they cheat, I could simply replace it.. ) obviously it's a dump idea to buy 400gb SD-Cards.. :D SSD is the better storage.. in terms of durability & speed, that's no question. But then I would go for an SBC which is focused for such an use-case (e.g. a HC1, or some rk3399 based one). They are properly powered for such use-cases and have enough bus speed to use it. ;) It's just an use-case where the Pi doesn't shine. Can it work? Sure, IMO you just limit your SSD by the SBC you use but we're going off-topic here.
Use the pi where it shines.. and others where they shine.
I don't see many use-cases where a RPi with large storage makes sense and even then, I would probably separate OS (on SD-Card) from data (large storage).
taylorkh wrote:
Sat Jan 26, 2019 2:35 pm
p.s. Sandisk customer service determined that the troublesome 64 GB MicroSD card which stated all this was a counterfeit. Ebay refunded my money and I have reported the phony item to them. I do not know if the seller was intentionally selling these things or if they had gotten into the supply chain before he got a hold of them.
that's what F3 is made for.. :P https://packages.debian.org/sid/utils/f3
always check your SD-Cards prior to use...

User avatar
bensimmo
Posts: 4712
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: SD Card speed - Pi limitation ?

Sat Jan 26, 2019 5:14 pm

Back to A1 and A2...
Can the Pi make use of A2 yet? Have drivers or whatever is needed been made?
I know A1 does not have that limitation.


And if anyone did want to compare to other Pi card, fruitoftheloom posted a link to a small download to run the benchmarks, you can then compare to all the others on there (and in the comments).

jahboater
Posts: 5927
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: SD Card speed - Pi limitation ?

Sat Jan 26, 2019 5:20 pm

bensimmo wrote:
Sat Jan 26, 2019 5:14 pm
Back to A1 and A2...
Can the Pi make use of A2 yet? Have drivers or whatever is needed been made?
Good question.
A2 cards work fine on the Pi of course, I use them on three Pi's.
But I don't know if the drivers are sorted yet and the full 4000 IOPS are available.
If not, I doubt it will be long to wait.

chwe
Posts: 159
Joined: Tue Jul 31, 2018 1:35 pm

Re: SD Card speed - Pi limitation ?

Sat Jan 26, 2019 5:45 pm

jahboater wrote:
Sat Jan 26, 2019 5:20 pm
bensimmo wrote:
Sat Jan 26, 2019 5:14 pm
Back to A1 and A2...
Can the Pi make use of A2 yet? Have drivers or whatever is needed been made?
Good question.
A2 cards work fine on the Pi of course, I use them on three Pi's.
But I don't know if the drivers are sorted yet and the full 4000 IOPS are available.
If not, I doubt it will be long to wait.
there you go...
https://github.com/ThomasKaiser/Knowled ... D_cards.md

Return to “General discussion”