Spider.007
Posts: 34
Joined: Sat May 19, 2012 11:24 am
Contact: Website

bonnie++: SD-card / USB-stick / NFS comparison

Sat May 19, 2012 2:56 pm

I decided to run Bonnie++ to find the most suitable medium for my primary filesystem, and I might as well share the results. Too bad this forum doesn't support tables, and bonnie's default output is very unreadable. So I'll just have to post them like this.

I have arm_freq set to 900, and I am using the 192 / 64 split. I will update the table with a USB-hdd when I find a hub to power it :)

User avatar
Morgaine
Posts: 141
Joined: Mon Mar 12, 2012 1:13 am

Re: bonnie++: SD-card / USB-stick / NFS comparison

Mon May 21, 2012 9:51 pm

Spider.007 +1. Actually, make that Spider.007 +100.

The well-known engineering mantra applies:
  • What you haven't measured you don't actually know, even when you think you do.
Full marks for starting to put understanding of the Pi's I/O performance on a solid engineering footing. Thank you.

Morgaine.
Intolerance is a failure of education. Education is predicated on tolerance of the uneducated.

jimbox51
Posts: 5
Joined: Thu Apr 12, 2012 6:57 pm

Re: bonnie++: SD-card / USB-stick / NFS comparison

Sun May 27, 2012 7:22 pm

For the NFS tests what were your wsize and rsize values for the nfs mount?

Spider.007
Posts: 34
Joined: Sat May 19, 2012 11:24 am
Contact: Website

Re: bonnie++: SD-card / USB-stick / NFS comparison

Mon May 28, 2012 6:23 pm

@ Morgaine, thanks! I'll see if I can keep my data up-to-date, and maybe test new firmware too
jimbox51 wrote:For the NFS tests what were your wsize and rsize values for the nfs mount?
I didn't change the defaults; and (looking at another nfs-client) I think the default is 1048576 for both r&w

lanlafi
Posts: 16
Joined: Sat Jun 02, 2012 9:15 am

Re: bonnie++: SD-card / USB-stick / NFS comparison

Sat Jun 02, 2012 3:19 pm

Could some of you please run these simple speed tests, and post the results?

Read speed test of the SD Card:

root@pisces:~# hdparm -t /dev/mmcblk0

/dev/mmcblk0:
Timing buffered disk reads: 14 MB in 3.22 seconds = 4.35 MB/sec

root@pisces:~# dd if=/dev/mmcblk0 of=/dev/null bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 23.8098 s, 4.4 MB/s

As you can see, the SD Card read speed is about 4.4 MBytes/sec. This SD Card is capable of 19 MBytes/sec in an USB SD Card Reader on a PC.

SD Card Write speed test:

root@pisces:~# dd if=/dev/zero of=100mb.bin bs=1M count=100 oflag=direct
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 23.6013 s, 4.4 MB/s

(don't forget to delete the created 100 mbyte file with rm 100mb.bin)

So the write speed is similar to the read speed, and it is much slower than the same card on the PC.

USB Pendrive Read Test:

root@pisces:~# hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads: 46 MB in 3.07 seconds = 14.98 MB/sec

root@pisces:~# dd if=/dev/sda of=/dev/null bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 6.93656 s, 15.1 MB/s

So, the USB Pendrive delivers more than three times the data compared to the SD Card.

USB Pendrive write speed test:

plugged it in, mounted it, and cd-d to the directory:

root@pisces:/media/pendrive# dd if=/dev/zero of=100mb.bin bs=1M count=100 oflag=direct
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 19.189 s, 5.5 MB/s

(again, don't forget to delete the 100mb.bin file)

Here is the interesting thing, the USB write speed is much slower than the read speed. This pendrive is capable of 10+MByte/sec write speed on a PC.

Could you test and post your results?

spurious
Posts: 343
Joined: Mon Nov 21, 2011 9:29 pm

Re: bonnie++: SD-card / USB-stick / NFS comparison

Sat Jun 02, 2012 3:33 pm

Linux raspberrypi 3.1.9+ #90 Wed Apr 18 18:23:05 BST 2012 armv6l

root@raspberrypi:~# hdparm -t /dev/mmcblk0
/dev/mmcblk0:
Timing buffered disk reads: 14 MB in 3.14 seconds = 4.46 MB/sec

root@raspberrypi:~# dd if=/dev/mmcblk0 of=/dev/null bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 22.5715 s, 4.6 MB/s

root@raspberrypi:~# dd if=/dev/zero of=100mb.bin bs=1M count=100 oflag=direct
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 27.6904 s, 3.8 MB/s

dukla2000
Posts: 190
Joined: Tue Jan 10, 2012 12:02 am
Location: Reading.UK.EU

Re: bonnie++: SD-card / USB-stick / NFS comparison

Sun Jun 03, 2012 12:01 am

I think it is fair to say we have known for some time the SDcard interface on the model B Pi is "challenged".

Code: Select all

root@pisces:/home/raspbian# hdparm -t /dev/sda3

/dev/sda3:
 Timing buffered disk reads:  66 MB in  3.09 seconds =  21.37 MB/sec

root@pisces:/home/raspbian# dd if=/dev/sda of=/dev/null bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 4.87209 s, 21.5 MB/s

root@pisces:/home/raspbian# dd if=/dev/zero of=100mb.bin bs=1M count=100 oflag=direct
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 6.14744 s, 17.1 MB/s
OK so I am cheating - my SD card is 128Mb with DOS partition only and I am running rootfs on my USB stick. Not clear why your USB stick write speed is so poor for a large contiguous file - based on my numbers clearly not completely the Pi's fault. The challenge is going to be to find the best performing USB stick.

ps - should also mention I am running arm_freq=850 - suspect Raspian gives me more of a kick than the overclock though.
Daily driver: Pi3B, 64GB Samsung Evo+ @100MHz, DVB-T, onboard WiFi for internet, BT/USB dongle for KB/mouse, 250GB HDD via USB for media, Raspbian Jessie Lite with Openbox desktop.
Museum: Pi B

Yoda007
Posts: 44
Joined: Mon Jan 23, 2012 6:05 pm

Re: bonnie++: SD-card / USB-stick / NFS comparison

Wed Jun 06, 2012 5:56 pm

My Pi arm_freq is overclocked to 750 Mhz. Didn't change the voltage because of warranty.
Debian image updated wit rpi-update:

Code: Select all

uname -a
Linux raspberrypi 3.1.9+ #101 PREEMPT Mon Jun 4 17:19:44 BST 2012 armv6l GNU/Linux
The SD card is Sandisk 8 GB Class 4. Results:

Code: Select all

/dev/mmcblk0:
 Timing buffered disk reads:  14 MB in  3.13 seconds =   4.47 MB/sec

dd if=/dev/mmcblk0 of=/dev/null bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 23.3928 s, 4.5 MB/s

dd if=/dev/zero of=100mb.bin bs=1M count=100 oflag=direct
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 34.8918 s, 3.0 MB/s

semtex
Posts: 63
Joined: Sat Mar 03, 2012 4:54 am

Re: bonnie++: SD-card / USB-stick / NFS comparison

Thu Jun 07, 2012 2:20 am

On a related note, has anyone managed to get Disk Utility (aka palimpsest) running on RasPi? This has a filesystem benchmark option but it does nothing when I run it!

lanlafi
Posts: 16
Joined: Sat Jun 02, 2012 9:15 am

Re: bonnie++: SD-card / USB-stick / NFS comparison

Thu Jun 07, 2012 5:40 pm

I've tested an 2.5" HDD via USB, plugged into a powered USB HUB, and both linear read and write was about 20 MByte/sec. So my USB Pendrive seems to have some kind of problem that it can only write 5 MByte/sec.

We can say, that the SD Card interface is limited to about 4.5 MByte/sec, no matter how fast SD Card is put into it at the moment. So for a better performing system, we have to use an USB attached storage device (pendrive, HDD) as root partition, and the SD card is only for booting.

YorkshireBoy
Posts: 2
Joined: Sat May 26, 2012 9:04 pm

Re: bonnie++: SD-card / USB-stick / NFS comparison

Thu Jun 07, 2012 9:01 pm

I am using an SD card to boot and then it hands over to a RunCore SSD via the in built USB connector. It's not a current product line, it's an old 70mm PATA or SATA SSD for netbooks that I had spare.

Anyway, these are the scores using the tests lanlafi asked us to post:

pi@raspberrypi:~$ sudo hdparm -t /dev/sda2

/dev/sda2:
Timing buffered disk reads: 74 MB in 3.01 seconds = 24.60 MB/sec

pi@raspberrypi:~$ sudo dd if=/dev/sda2 of=/dev/null bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 3.97801 s, 26.4 MB/s

rpi@raspberrypi:~$ sudo dd if=/dev/zero of=100mb.bin bs=1M count=100 oflag=direct
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 4.52864 s, 23.2 MB/s

So, quite nippy really for a USB device. I rarely get beyoung 25 MB/s using a USB drive on my PC.

Trollslayer
Posts: 1
Joined: Sun Jun 10, 2012 9:49 am

Re: bonnie++: SD-card / USB-stick / NFS comparison

Sun Jun 10, 2012 9:56 am

For the SD card - the class of a card makes a big difference.
An unclassified card cour have read/write speeds of anything - even 1MB/sec.
Basically the class number is the write speed in MB/sec but the read speed isn't part of the class although naturally you can expect it to be faster than the write speed.
I had an unclassified Sandisk card I used on an ITX PC for XBMC and switching to a class 6 but with peak read speeds of 24MB/sec made it very responsive.
So if you have an intensive applicaiton that seems sluggish, consider a decent SD card. Apparently the read speed doesn't change a lot from class 6 to class 10 because you are hitting the limit of standard SD interfaces.

normal
Posts: 61
Joined: Sun May 27, 2012 9:50 pm

Re: bonnie++: SD-card / USB-stick / NFS comparison

Sun Jun 10, 2012 10:01 pm

I learned that the place of manufacture could matter more -- a class 4 card from a reputable plant could be much faster than a cheap class 6.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: bonnie++: SD-card / USB-stick / NFS comparison

Mon Jun 11, 2012 10:57 am

There's a custom kernel available towards the end of this thread http://www.raspberrypi.org/phpBB3/viewt ... =63&t=5057 that has a much faster SD card driver - please help to test it 8-)
Increases the read speeds on my Class6 card from 4MB/s to 18MB/s !

lanlafi
Posts: 16
Joined: Sat Jun 02, 2012 9:15 am

Re: bonnie++: SD-card / USB-stick / NFS comparison

Tue Jun 12, 2012 6:48 am

AndrewS wrote:There's a custom kernel available towards the end of this thread http://www.raspberrypi.org/phpBB3/viewt ... =63&t=5057 that has a much faster SD card driver - please help to test it 8-)
Increases the read speeds on my Class6 card from 4MB/s to 18MB/s !
Thanks for pointing me to this thread.

I've also seen this page: http://elinux.org/RPi_Performance which shows that Fedora is able to read/write quicker. This also proves that it is not a hardware limitation.

I really hope the developers can fix this quickly, and it gets into the official RPi kernel.

selsinork
Posts: 151
Joined: Mon Apr 16, 2012 8:31 am

Re: bonnie++: SD-card / USB-stick / NFS comparison

Wed Jun 13, 2012 10:34 am

lanlafi wrote: I've also seen this page: http://elinux.org/RPi_Performance which shows that Fedora is able to read/write quicker. This also proves that it is not a hardware limitation.
Actually, it probably only proves that fedora is using different filesystem mount options or a different filesystem altogether.

As mentioned at the top of the SD Card section, you really need to add i/oflags=direct, you also need everyone to be using the same 'init_emmc_clock=' in /boot/config.txt and to eliminate any filesystem performance differences you should run the tests against a raw block device, i.e. /dev/mmcblk0p3

Simplistically I see twice the write performance against the block device that I see when writing to a file on a mounted ext3 filesystem which gives you some idea of the filesystem overhead. Fedora may simply be using ext4 and delaying the end of the write until after the command returns. It should also be interesting that there's a F17 result with the same performance as most of the rest and a Debian result that surpasses the F17 for read.

Please try the custom kernel AndrewS pointed at, it's proving to be very much better. The more people who test it and post their findings the better chance it'll get into the official kernel.

Antimidas
Posts: 10
Joined: Sat Sep 01, 2012 1:59 am

Re: bonnie++: SD-card / USB-stick / NFS comparison

Sat Sep 01, 2012 3:37 am

Just got my RPi today and have installed wheezy with rpi-update and ran all updates. I am using a SanDisk 32GB Class 10 microSDHC in an adapter - only $30 at my local Best Buy.

pi@rpi1 ~ $ sudo hdparm -t /dev/mmcblk0
/dev/mmcblk0:
Timing buffered disk reads: 62 MB in 3.09 seconds = 20.06 MB/sec

pi@rpi1 ~ $ sudo dd if=/dev/mmcblk0 of=/dev/null bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 5.00373 s, 21.0 MB/s

pi@rpi1 ~ $ sudo dd if=/dev/zero of=100mb.bin bs=1M count=100 oflag=direct
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 14.0239 s, 7.5 MB/s

Return to “Advanced users”