How to increase SD card speeds on a Raspberry Pi

Posted on under English, Technology, Tutorials

I have encountered a problem with the Raspberry Pi 3B that I have and a new Kingston 64 GB microSD card. The card is rated for UHS-I / Class 10 performance, implying at least 10 MB/s read. However, the performance of the card was very poor, around ~5 MB/s, which left the OS sluggish. In fact, it was so sluggish, it would often timeout while trying to read files during boot, which would cause the kernel to panic and freeze the system.

The solution is to overclock the eMMC bus. As always, everything you do is at your own risk, however, there shouldn’t be more than usual longer term damage to the SD card, and none to the Raspberry Pi. If the device doesn’t boot, you can revert the settings from a PC by connecting the SD card, or just overwrite it with a fresh system image. ALso, these instructions only work on Raspbian.

The procedure is very simple, and consists of adding the following line to the file /boot/config.txt, then saving the file and rebooting the Pi (preferrably from the CLI/GUI and not by unplugging it, which can damage the filesystem).

init_emmc_clock=250000000

Here are the initial test results (fresh install of Raspbian Lite as of 09-2019):


[email protected]:~ $ dd if=/dev/zero of=~/test.tmp bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 51.2393 s, 10.2 MB/s
[email protected]:~ $ sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
3
[email protected]:~ $ dd if=~/test.tmp of=/dev/null bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 109.687 s, 4.8 MB/s
[email protected]:~ $

And here are the test results after applying the fix and rebooting the Pi:


[email protected]:~ $ dd if=/dev/zero of=~/test.tmp bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 52.3676 s, 10.0 MB/s
[email protected]:~ $ sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
3
[email protected]:~ $ dd if=~/test.tmp of=/dev/null bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 22.6414 s, 23.2 MB/s
[email protected]:~ $

As you can see, the read performance has increased by almost 5 times, and remains consistent, while the OS feels snappier.