Tests of I/O on various SD cards using Bonnie.

Delbert Franz ddf at sonic.net
Wed Nov 2 13:17:20 EDT 2011


I have done some testing of the various SD cards I have in my 
collection.  I used the C program, Bonnie, much used in the past.  It 
is relatively small and uncomplicated, at least relatively so:) It 
compiles fine on the Ben with no problems with the latest image.  I 
used whatever the default values were for compiling.  Perhaps some of 
these numbers would differ if everything in Bonnie were tuned to the 
precise CPU in the Ben.  That is over my head and in the past I found 
conflicting advice in a web search (That's nothing new, either!).  
Maybe some C and Mips expert could spell out what gcc options might be 
best:) 

Outline of procedure:

1. Bonnie was run from the rootfs in the Nand partition.

2.  Each card had two partitions on it: one that was about 1 GB in 
size and the other whatever was left over.  The 1 GB partition was 
called "small" (S) and the other was call "big" (B) file system.  

3.  Three different filesystems were tested: ext2, ext4, and in a more 
limited sample, ext4 without a journal.  

4.  Each file system was empty so the only file present during the 
tests was the one written by Bonnie.  

5.  The mount options were always: noatime,nodiratime.  

6.  Eight runs of Bonnie were made for each of the two different sizes 
of files systems.  Thus there were 16 runs for each file system.  Each 
run wrote and read 128 MB more than once.  The 16 runs took 
approximately one hour on the Ben.  

8.  The average value of the eight runs is reported in the table 
below.  I also computed the standard deviation, the minimum, and the 
maximum.  These are not reported to save space.  

9.  What I call the part number is what I thought the part number was.  
On some cards there are as many as three sets of numbers--I don't know 
which ones are important and which ones are not.  The Transcend part 
number that was too long is: MMAGR08GUDCA-DB and the one for the Cat 
10 Patriot is: N0303-001.A00LF 
 
10.  The speeds in the table are given in Kbytes/second as reported by 
the default configuration for Bonnie.  

----------------------------------------------------------------------------- 
    Summary of Bonnie I/O Tests on 
    Various Micro-SD Cards.


Make     Part#     Cap Cat FlSystm FsSz    CW     BCW    BCRW      CR     BCR 
------   --------  --- --- ------- ----  ----    ----    ----    ----    ----
Kngstn   K33045Y    8   4   Ext2    B    2378    2348    1859    3703    7989
                                    S    2437    2307    1864    3715    7979

Ptrt     E08213G   16   4   Ext2    B    3314    4053    3288    3871    7930 
                                    S    3373    4017    3234    3871    7977 

Kngstn   K33045Y    8   4   Ext4    B    3462    4766    2952    3871    7784
                                    S    3464    4790    2971    3850    7855
                                     
Ptrt     E08213G   16   4   Ext4    B    3431    4780    2950    3844    7977
                                    S    3465    4821    2954    3865    8002

Make     Part#     Cap Cat FlSystm FsSz    CW     BCW    BCRW      CR     BCR 
------   --------  --- --- ------- ----  ----    ----    ----    ----    ----
Trnscnda 9153BA     8   6   Ext2    B    3736    5651    3510    3918    7965
                                    S    3416    4607    3258    3885    7963

                    8   6   Ext4    B    3732    5510    3506    3920    8002 
                                    S    3690    5289    3410    3904    7973 

                    8   6   Ext4nj  B    3814    5850    3619    3918    7947 
                                    S    3826    5930    3639    3918    7985 

Trnscndb MMA...     8   6   Ext2    B    3601    5173    3286    3825    7884
                                    S    3609    5205    3299    3822    7900
                                     
                            Ext4    B    3632    5285    3348    3891    7878
                                    S    3646    5247    3325    3900    7883
                                     
                            Ext4nj  B    3755    5625    3415    3880    7873
                                    S    3789    5638    3433    3887    7881

Trnscndc MMA...     8   6   Ext2    B    3582    5171    3248    3807    7854
                                    S    3610    5089    3264    3817    7837
                                     
                            Ext4    B    3622    5241    3312    3884    7763
                                    S    3601    5172    3265    3881    7842
   
Trnscndd 9153BA     8   6   Ext2    B    3727    5641    3511    3926    7973
                                    S    3449    4578    3249    3887    7989
                                     
                            Ext4    B    3732    5549    3538    3915    7984
                                    S    3669    5278    3410    3904    7936
                          
Trnscnde MMA...     8   6   Ext2    B    3644    5164    3295    3830    7872
                                    S    3653    5268    3351    3827    7887
                                     
                            Ext4    B    3651    5290    3366    3899    7855
                                    S    3551    5265    3356    3898    7859

Make     Part#     Cap Cat FlSystm FsSz    CW     BCW    BCRW      CR     BCR 
------   --------  --- --- ------- ----  ----    ----    ----    ----    ----
Kngstn   N0302....  8   10  Ext2    B    3723    5488    3106    3874    7634
                                    S    3719    5266    3033    3876    7642
                                      
                            Ext4    B    3285    5198    2988    3871    7647
                                    S    3269    4434    2648    3816    7626
                                      
                            Ext4nj  B    3689    5555    3160    3882    7645
                                    S    3701    5269    2984    3878    7624
-----------------------------------------------------------------------------
Read or Write rate in KBytes per second.

Cat- Category
Cap - capacity in GB
CW - character by character write
BCW - write a block of characters 
BCRW - change a character and re-write the block
CR - character by character read
BCR - Read characters by block

Ext4nj - Ext4 with no journal
---------------------------------------------------------------------------- 
 
Observations on these results:

1.  The difference between the speeds for Ext2 and Ext4 depends on the 
card, and in some cases on the size of the file system.  So reasons 
other than write speed probably are more important, unless your card 
is one that is sensitive to the difference.  The effect of wear from a 
journal is discussed on the Web with conclusions that vary:)  I 
currently use Ext4 with a journal for my big data partition on a 32GB 
Transcend Cat 4 card and ext2 on the root partition (I believe this is 
required to boot because when I tried Ext4 I could not boot from the 
card.) 

2.  Read speeds are about the same across the cards.  Perhaps the rate 
is limited by the speed of the CPU or the bus used in the Ben.  

3.  Transcend cards that have the same category and capacity but 
different part numbers do seem to differ a bit in their writing speed.  
This difference is larger than the variability in each cards speeds so 
it looks real.  

4.  The Cat 10 card proves to be a bit disappointing in that is about 
the same as the better Cat 6 cards.  Again, this might be a limit set 
by the Ben and not the card.  No way to tell unless the card is tested 
on a more powerful machine with limited RAM.  The size of the file 
written should be a good bit larger than installed RAM to minimize the 
effect of data caching.  

5.  Using Ext4 without a journal is slightly faster on writing.  

Looking at these numbers a Cat 6 card looks like the best one for the 
Ben.  However, when I searched for 32GB cards, I found only Cat 4 and 
Cat 10 cards.  

This was interesting and time consuming.  Probably won't do it again:) 

               Delbert





More information about the discussion mailing list


interactive