JollyRoger
Posts: 154
Joined: Wed Feb 01, 2012 9:48 am

SD Card benchmarks a waste of time?

Thu Sep 06, 2012 8:07 pm

Why do sd cards with good benchmark readings go slow in the Pi, and vice versa? This is the impression I had with my sd cards, so to check this out I wrote an identical Raspbian image onto three different sd cards and timed their performances. I measured their boot times (from power-up to the lxde desktop appearing), their times to load Abiword, and their shutdown times. The results are shown below, together with their benchmark timings using hdparm -tT /dev/mmcblk0.

Sandisk SDHC Class 4 Card
Benchmarks: cached reads 173.47 MB/sec, buffered disk reads 10.57 MB/sec
Boot up time: 35 secs
Abiword load time: 13 secs
Shutdown time: 10 secs

Integral Ultima SDHC Class 10 Card (claims "up to 20 MB/sec")
Benchmarks: cached reads 181.10 MB/sec, buffered disk reads 18.91 MB/sec
Boot up time: 63 secs
Abiword load time: 13 secs
Shutdown time: 45 secs

Sandisk Ultra SDHC Class 10 Card (claims 30 MB/sec)
Benchmarks: cached reads 181.80 MB/sec, buffered disk reads 20.04 MB/sec
Boot up time: 30 secs
Abiword load time: 13 secs
Shutdown time: 10 secs

So the Sandisk Class 4 card, with a disk read benchmark almost half that of the two Class 10 cards, performed considerably better than the Integral Class 10 card and almost as well as the Sandisk Class 10 card. So do the benchmarks tell us anything about the actual performance of sd cards in the Pi?

As an aside, I have a 4-year old Transcend sd card (it's not SDHC and it has no class number printed on it), which performs really well. It has "133x" printed on the label, implying that it should be fast, and indeed its buffered disk read timings are almost the same as those of the Sandisk Ultra card above. This old card boots up Raspbian+lxde in 37 seconds. I did not include it in the above list as it does not have an identical image - it has Raspbian with Tomaz's XBMC + LXDE, which run really well on it.

User avatar
jojopi
Posts: 3268
Joined: Tue Oct 11, 2011 8:38 pm

Re: SD Card benchmarks a waste of time?

Thu Sep 06, 2012 8:28 pm

The SD Class system measures sequential write speeds. It is based on the assumption that you will use the cards in a video camera, or in a still camera taking repeated hi-res shots.

hdparm measures sequential read speeds. For magnetic media these are usually the same as the sequential write speeds, but for flash they may be much better than the write speeds. Sequential read speeds are rarely important in practice.

Boot and program startup times mostly measure latency for small random reads. But there will be some small random writes thrown in, and the much higher latency of these could be an important influence on the results.

For the most demanding applications, such as database storage, latency for small random accesses is the most important consideration. It is often measured in IOPS, input/ouput operations per second. This is an area where SSDs perform much better than traditional hard drives. But SD cards will not perform well, especially if the random accesses include a high proportion of writes.

rdatoc
Posts: 4
Joined: Wed Sep 05, 2012 10:21 pm

Re: SD Card benchmarks a waste of time?

Thu Sep 06, 2012 10:24 pm

The general consensus seems to be this rule of thumb: higher random 4k write speed/IOPS equals higher performance in general.

Should you have lots of time to spare ;) and want to get into the nitty-gritty, there is a long-running thread on XDADevelopers (http://forum.xda-developers.com/showthr ... ?t=1005633) where anecdotal evidence and benchmarks abound (including a Google Docs spreadsheet collecting said benchmarks in an easy to read table) for SD card performance vis-a-vis CM7 (Android OS) for the Nook Color. Plus the recent thread (there may be more) on this forum that covers that topic for the Pi (http://www.raspberrypi.org/phpBB3/viewt ... =63&t=4076).

CPOKashue
Posts: 52
Joined: Fri Sep 28, 2012 6:13 pm

Re: SD Card benchmarks a waste of time?

Tue Oct 16, 2012 8:22 pm

Had to jump in on this. I recently moved from a Mushkin class 10 card to a class 6 Sandisk Ultra because they were scoring highly in 4k random access benchmarks.

The difference has been night and day. The Pi boots in about HALF the time, and web browsing and messing about in X are actually tolerably quick now. I would say the difference to regular desktop use is the same as the change from a GPU favorable allocation of RAM to a CPU-favorable split.

So it definitely makes a difference and I would throw my vote in the "Sandisk Ultra rules, class is irrelevant" camp.

ltore123
Posts: 2
Joined: Sun Mar 22, 2015 10:16 pm

Re: SD Card benchmarks a waste of time?

Tue Dec 01, 2015 8:26 pm

16gb sd card+16gb usb flash disk Raid 0 Raspbery Pi 2

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

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

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

/dev/md127:
Timing cached reads: 670 MB in 2.00 seconds = 334.32 MB/sec
root@raspberry:~# hdparm -T /dev/md127

/dev/md127:
Timing cached reads: 664 MB in 2.00 seconds = 331.41 MB/sec

ceribik
Posts: 1
Joined: Mon Dec 28, 2015 12:47 am

Re: SD Card benchmarks a waste of time?

Mon Dec 28, 2015 12:54 am

The reason for this is because for Class 2, 4 and 6 sdcards, the write speeds for them are guaranteed for fragmented data, where as for class 10, the speed is only guaranteed for unfragmented data. As a result, a good Class 4 or 6 card will often perform better for running a linux system than a class 10 sdcard.

Return to “General discussion”