Raspberry Pi SD card benchmark

Another update: Sebastian Sjoholm very kindly sent the results of him benchmarking his own Raspberry Pi with both a 4GB SD card (Samsung) and a 60GB OCZ Vertex SSD connected via a USB to SATA adapter. On firmware 346337 he used kernel version 3.2.27 and on 364242 he used 3.6.11. This makes it tricky to know whether the firmware or kernel version is having an effect on the differing results, so take those with a pinch of salt. It appears the SSD and SD card give similar read performance, but much different write performance. Worth knowing, thanks Sebastian!

Device Firmware Cache Read Buffer Read DD Read DD Write
4GB SD Card 346337 71.90 MB/s 17.33 MB/s 19.8 MB/s 7.8 MB/s
364242 156.86 MB/s 17.98 MB/s 20.2 MB/s 8.0 MB/s
OCZ Vertex Plus 60Gb SSD 346337 155.21 MB/s 18.37 MB/s 20.4 MB/s 17.9 MB/s
364242 161.92 MB/s 24.20 MB/s 24.6 MB/s 22.9 MB/s

Update: It’s possible that the new Raspberry Pi beta of Debian ‘wheezy’ (I tested using ‘squeeze’) will give better performance than what I detail here.

I notice a lot of people massively overestimating the performance a Raspberry Pi in the media and on their forums; people discuss using it as a file server or a network router, neither of which it would be great at doing.

To demonstrate this, I have done a quick benchmark of SD card read performance on the Raspberry Pi today using hdparm which is admittedly designed for ATA drives, but I don’t think that matters. I’m using this Class 10 16GB SDHC card.

pi@raspberrypi:~$ sudo hdparm -t /dev/mmcblk0
/dev/mmcblk0:
  Timing buffered disk reads:  14 MB in  3.13 seconds =   4.48 MB/sec

pi@raspberrypi:~$ sudo hdparm -T /dev/mmcblk0
/dev/mmcblk0:
  Timing cached reads:   136 MB in  2.02 seconds =  67.30 MB/sec

The important value is the first one, showing 4.4MB/s. A Class 10 SD card can theoretically reach 10MB/s so I’m guessing 6MB/s is lost on the USB bus or Linux SD card driver; which is a lot. I don’t know if the same performance would be achieved with an external USB hard drive, I expect the answer is ‘probably’.

For comparison, here’s a consumer SATA drive in my Linux server:

jalada@tombraider:~$ sudo hdparm -t /dev/sdb
/dev/sdb:
  Timing buffered disk reads: 368 MB in  3.01 seconds = 122.10 MB/sec

jalada@tombraider:~$ sudo hdparm -T /dev/sdb
/dev/sdb:
  Timing cached reads:   1946 MB in  2.00 seconds = 973.86 MB/sec

It would be interesting to benchmark the SD card in another machine, to see if I’m right about the lost 6MB/s.

Edit: At request, I benchmarked the same SD card in another device. I benchmarked using my SD card slot in my Macbook Air. I’ll admit the test is different as I couldn’t use hdparm, instead I used ‘AJA System Test’.

The results were:

Write: 13.6MB/s
Read: 20.5MB/s

Given that this is a Class 10, those results seem a little high, but I guess it should help give a rough idea of the difference in performance. If I get chance, I’ll do the same test with hdparm on Linux.

This entry was posted in Blog, Raspberry Pi. Bookmark the permalink.
  • Kk

     useless if you don’t benchmark the SD card in another machine

    • I assumed that as it was rated as Class 10, it should achieve 10MB/s random access. But sure, I’ll benchmark in something else to compare and update the post.

      • Rodney

        root@raspberrypi:/dev# hdparm -t /dev/mmcblk0

        /dev/mmcblk0:
        Timing buffered disk reads: 62 MB in 3.07 seconds = 20.22 MB/sec

  • Pingback: Transcend 16GB vs. SanDisk Extreme 32GB SDHC Card | Jalada()

  • Zzzzz

    A network router wouldn’t really use or rely on the sd card at all, would it? and theres no reason to assume you couldn’t attach a usb disk drive to the Pi for faster r/w. Although im not trying to say it would be the best at either task! 😛

    • Agreed, but remember the bandwidth across the Ethernet and USB are shared.

  • Jesse Schoff

    I’ve only been looking into buying an SD card for my recently shipped Raspberry Pi for an hour, and already I’ve found that your findings are unreliable.

    First, the Class 10 does indeed mean 10MB/s, but it’s the minimum rated write speed, which means that your results on your macbook pro are reasonable.

    Second, these rated speeds are for sequential write; in your comment you state that you expect it should acheive 10MB/s random read. This will not happen. You should expect between .1 – 1MB/s 4k random read speed.

    Beyond that, who is to say that you couldn’t use the RPi for a rudimentary file server? Even though the ethernet is run on the USB2 bandwidth, maximum theoretical throughput for USB2 spec is 60MB/s. What do you need to stream 1080p video? 2-5MB/s max? Even at 10MB/s, you could still host video with no problem. Say you only get half the theoretical speed, and pull 30MB/s, that is still plenty to to both read and write to a USB drive and stream over ethernet.

    • Thanks for your clarifications, I didn’t realise that the classification was a minimum, this makes a lot more sense.

      I’m fairly sure USB2 only gives you 60MB/s at burst, and the effective throughput is much less (maybe 35MB/s?).

      I agree, it sounds achievable. But there’s plenty of overhead and not a lot of breathing space. You’re also probably going to peg the CPU as it manages all of those packets. This may not apply so much on the new distributions.

      I think I’ll settle this by trying out my Raspberry Pi with an external SATA enclosure, set it up as a file server, and see what kind of performance I get out of it. It might be that what I consider ‘reasonable’ as a file server is not what others consider reasonable, perhaps I have higher standards!

      For the record, I did a quick benchmark with the new Raspbian distribution, and it hit values much closer to my MacBook benchmark, which is good! 🙂

    • Scott

      I will add to your comment:

      For several years I have been happily storing my NAS content on an old Linksys NAS200. The NAS200 has abysmal write speeds and will serve files at 5-10MB/sec tops depending on your drives and protocol.

      The NAS200 is plenty fast enough to serve 1 stream of video, but any large scale disk activity (like copying MP3 folders) can exhaust your patience.

      Some folks (like myself) cling to the NAS200 because nothing has come along that’s as cheap and as quiet and with as decent of a web-management interface. (There’s plenty of good NAS appliances out there, but the NAS200 was dirt-cheap!).

      Your benchmarks on the Pi are wayyyy faster than what I’d get if I ssh into the NAS200 and ran the same test. So what I am saying is, the NAS200 is a perfectly reasonable NAS controller for an _individual_ or small home.

      ALSO – The Pi Model B (with 2 USB ports) is actually a USB HUB chained behind a USB port. The Pi CPU supports ONE USB device. That’s why the Model A has one port and no Ethernet. The model B Pi has 1 USB port connected to a hub with THREE ports (USB A, USB B, and Ethernet). Therefore it’s reasonable that any performance test on the Pi model B could be radically different on the model A. Just sayin’.

  • Luca Garulli

    These are my results with a RaspberryPI 512Mb RAM and a SD class 10 (Sandisk ultra)

    pi@raspberrypi /etc $ sudo hdparm -tT /dev/mmcblk0

    /dev/mmcblk0:

    Timing cached reads: 346 MB in 2.01 seconds = 172.27 MB/sec
    Timing buffered disk reads: 60 MB in 3.00 seconds = 19.97 MB/sec

    Not bad afterall!

    Lvc@

  • Pingback: New Raspberry Pi SD card and SSD benchmarks | Jalada()

  • Pingback: Odroid emmc speeds | Primal Cortex's Weblog()

  • Levent Tore

    16gb sd card +16gb usb flash Raid 0
    Raspberry pi 2
    root@raspberry:~# hdparm -t /dev/md127

    /dev/md127:
    Timing buffered disk reads: 114 MB in 3.03 seconds = 37.68 MB/sec

  • Levent Tore

    root@raspberry:~# hdparm -T /dev/md127

    /dev/md127:
    Timing cached reads: 670 MB in 2.00 seconds = 334.32 MB/sec