Remix.run Logo
DanielHB a day ago

I got a raspberry 4 recently and was tinkering with it. I was appalled at the apparent disk IO performance of the thing, opening a browser takes several seconds.

Is that just me or do I have a particularly crappy SD card? Anyone got any tips on how to improve disk IO? Would a USB3 external drive help with this?

justin66 a day ago | parent | next [-]

> Would a USB3 external drive help with this?

Emphatically yes. It's an entirely different experience using a RPi 4 with a quality SSD. [0] It's also more expensive, so you have to decide whether that's important to you.

[0] https://www.samsung.com/us/computing/memory-storage/portable...

In my opinion it's a mistake to split the difference with a cheap SSD or one you need to plug in using a SATA to USB adapter. (troubleshooting first step: if it's not the power supply, it's the SATA to USB adapter...)

antihero a day ago | parent | prev | next [-]

Perhaps the M.2 HAT+ and a decent SSD?

USB3 could plausibly be faster than the SD card as the spec allows for 5Gbps+ but I don't know about Pis that much, I'd defer to someone with experience.

As a photographer I can tell you that SD cards, even high class ones have laughably awful speeds - any proper camera that needs to do video will use CFexpress Type B cards which are tremendously faster.

jsheard a day ago | parent | next [-]

> Perhaps the M.2 HAT+ and a decent SSD?

That won't help OPs Pi4, the PCIe interface is new on the Pi5. USB is the best you can do on the older ones.

antihero a day ago | parent [-]

Good to know!

wrboyce a day ago | parent | prev [-]

Proper cameras use film ;)

Seriously though, there are plenty of top-end cameras that use SD cards (all Nikons, for example).

EDIT: completely missed that you said video, ignore me!

bmicraft 15 hours ago | parent | prev | next [-]

I'm always astounded how little people know about this, but you need to get an Application Class rated card, preferably A2. [1] The application rating essentially ensures a certain minimum IOPS performance, which is critical because most cards are only intended for sequential reads/writes.

[1] https://en.wikipedia.org/wiki/SD_card#Application_Performanc...

teamonkey a day ago | parent | prev | next [-]

The Pi 4's IO is not great, but the choice of SD card affects it a lot. Brand seems to have more of an impact than speed (or at least the stated speed of the card). Cheap knockoffs will absolutely kill performance. That's why Raspberry Pi started selling their own branded SD cards.

Using an external USB3 drive also helps but it's still pretty slow. I found it too slow to use as a SAMBA file server when connected over WiFi, even though it was hardly pushing the CPU or memory. It would regularly fail to transfer large files.

One of the main selling points of the Pi 5 is faster IO. I'd love to see something tiny and power-sipping like the Zero but with the enhanced IO of the Pi 5.

DanielHB a day ago | parent [-]

I am using a USB3 drive as a samba drive and it works fine, although I use it mostly for streaming video not to transfer large files.

My OS however is in the SD card which is Sandisk which I assumed was the good fair price brand.

cillian64 a day ago | parent | prev | next [-]

There is quite a bit of variation between SD cards, browser taking several seconds is surprisingly bad.

On Pi 4 I use a 2.5" SATA SSD (WD blue) on a startech USB3 adaptor and the performance seems to me much better than even good quality microsd cards.

esskay a day ago | parent | prev | next [-]

No it's not just you. I/O on the Pi4 and below is awful, but for most applications it doesn't matter. Not sure on the Pi 5 as I jumped ship after the scalping and overall negativity around the foundation's activities in the last few years but I expect it's a fair bit better.

Joel_Mckay a day ago | parent | prev [-]

In general, sdcards are slow... most use kernel cache lazy page flush if the pi4 has 8GB ram, and F2FS to improve flash reliability.

After, "sudo apt-get install preload" it will cause previously used programs from the last session to auto-cache into ram. Combined with the above setting, the usual programs will launch much faster.

There is also the option to use an external SSD drive for better performance.

Part of the fun of pi4 was getting the OS optimized, but unless you have a legitimate "Sandisk Extreme Pro U3" or >30MB/sec rated sdcard it can still be slow (people have seen 4MB/sec on old counterfeit cards.)

sdcard bus overclocking is a thing as the pi tries to maximize slow hardware compatibility by default. Note this feature is limited on the pi4, but can significantly decrease boot times on older models.

YMMV =)