SD_Header

SD speed class – it matters for Raspberry Pi disk performance.

The Raspberry Pi uses Secure Digital (SD) cards for non-volatile internal storage.

SD cards vary mainly on two factors:

  1. Size (GB)
  2. Speed

The cost of SD cards is usually a function of their size and speed. There are many different levels of “speed” for SD card represented by a “class” rating of 2, 4, 6, and 10. The number is ideally (but not always) the maximum throughput of the card in MB/Sec.

Raspberry Pi disk performance

While it may have been a silly thing to wonder, I was curious if the Raspberry Pi disk performance would be impacted by the SD speed class I selected. I wanted to see if I’d actually see a practical real-world difference between different SD card “classes” in two of my Raspberry Pi computers.

Comparing SD class performance

For this test, I used two Raspberry Pi “B” models, revision 1.1. I obtained two SD cards and installed the newest clean version of Raspbian on them. The SD cards I used were these two units:

To benchmark the IO performance, I used Phoronix Test Suite v4.4.1 with the Dbench 4 test. All services which would cause disk performance degradation were stopped. The two units were set up identically (same file system, services, etc.)

The results

The results show a signifiant difference in performance between the class 4 and class 10 cards. The class 4 card had an average performance of 0.87 MB/sec while the class 10 card had an average performance of 5.75 MB/sec

Class 4 results

Phoronix Test Suite v4.4.1
System Information

Hardware:
Processor: ARMv6-compatible rev 7 @ 1.00GHz (1 Core), Motherboard: BCM2708, Memory: 485MB, Disk: 4GB SD04G

Software:
OS: Debian Linux 7.0, Kernel: 3.6.11+ (armv6l), Compiler: GCC 4.6, File-System: ext4, Screen Resolution: 656x416

    Would you like to save these test results (Y/n): n


Dbench 4.0:
    pts/dbench-1.0.0 [Client Count: 1]
    Test 1 of 1
    Estimated Trial Run Count:    3
    Estimated Time To Completion: 37 Minutes
        Started Run 1 @ 20:39:29
        Started Run 2 @ 20:51:32
        Started Run 3 @ 21:03:35  [Std. Dev: 1.01%]

    Test Results:
        0.860377
        0.861668
        0.876174

    Average: 0.87 MB/s

Class 10 results

Phoronix Test Suite v4.4.1
System Information

Hardware:
Processor: ARMv6-compatible rev 7 @ 1.00GHz (1 Core), Motherboard: BCM2708, Memory: 485MB, Disk: 16GB SD

Software:
OS: Debian Linux 7.0, Kernel: 3.6.11+ (armv6l), Compiler: GCC 4.6, File-System: ext4, Screen Resolution: 656x416

    Would you like to save these test results (Y/n): n


Dbench 4.0:
    pts/dbench-1.0.0 [Client Count: 1]
    Test 1 of 1
    Estimated Trial Run Count:    3
    Estimated Time To Completion: 37 Minutes
        Started Run 1 @ 12:24:17cd ..
        Started Run 2 @ 12:36:21
        Started Run 3 @ 12:48:23  [Std. Dev: 5.57%]
        Started Run 4 @ 13:00:26  [Std. Dev: 6.80%]
        Started Run 5 @ 13:12:29  [Std. Dev: 5.91%]
        Started Run 6 @ 13:24:34  [Std. Dev: 5.88%]

    Test Results:
        6.0909
        5.55299
        6.15532
        5.36009
        5.88421
        5.46419

    Average: 5.75 MB/s

Conclusion

There was a major difference between the two cards. Given the small incremental cost difference between the two, the class 10 cards are likely worth the extra expense, especially in cases where disk IO is important. I also won’t be using class 4 cards in my units as it looks rather pitiful.

One should keep in mind that the performance will vary with other tests and by manufacturer. Moreover, there are “ultra” cards which offer better performance and may offer better IO than the class 10 card I tested.

Published by

James Malone

Technology leader, runner, dinosaur aficionado, Lego master, code caper, data pundit, MBA monkey, and ResEdit OG in search of sunshine, speed, and adventures.

14 thoughts on “SD speed class – it matters for Raspberry Pi disk performance.”

    1. I bet! I wanted to see if the hardware limited the throughput somehow; appears not. I want to try an Ultra-level card to see if it makes a difference.

  1. Excellent. I for one appreciate your efforts.
    When looking for this info, there’s all kind of BS scattered all over.
    You, mate, have done it correctly. Pitty you didn’t have more cards to test with.

  2. “While it may have been a silly thing to wonder.” Not silly at all, I was wondering the same thing while putting my first RPi through its paces. Thanks for doing the testing and publishing your results.

  3. It seems like you compared a 4GB Class 4 Micro SDHC card from one manufacturer with a 16GB Class 10 SDHC card from a completely different manufacturer.

    Wouldn’t an equally valid conclusion be that Dane-Elec makes lousy SD cards? Or that micro-cards are slower than full-size cards? Or that higher-capacity cards perform better?

    1. Glad I’m not the only one wondering why he assumes that speed only depends on the SD class…

    1. Note that flash memory performance is also affected by how much the card has been used (written). In many of these sorts of tests, people are comparing a newly purchased card against cards that they were previously using in cameras or other devices.

      Both read and write speeds are affected by use, but TRIM also gets slower on a flash memory drive which has seen too many write cycles.

  4. Thank you! installing NOOBS for the first time and it’s taking a while. I had one of each SD card in hand at the store and went with the class 4… kept the receipt. I’m going back to swap now! OSes are being written @ 2.1MB/sec… taking forever :-/

  5. But correct me if I’m wrong…. isn’t it so that in addition to a card’s read and write performance degrading as a function of time, the performance usually radically depends on the size of the files written. So, many SD cards can store large files quickly, but since running an OS requires writing smaller files quite often, it is hard to say how much one can extrapolate from performance with larger files to how well the card would work as a boot location for an OS. This test appears to be reading & writing a 25 MB file, whereas a running OS would be mostly using files under 1 MB…

Leave a Reply