5,593,587 Members 37,706 Now Online
XDA Developers Android and Mobile Development Forum

[APP] Bonnie++ for Android - Command Line Disk Benchmark

Tip us?
 
saturn_de
Old
(Last edited by saturn_de; 15th July 2011 at 08:37 AM.)
#1  
saturn_de's Avatar
Senior Member - OP
Thanks Meter 148
Posts: 140
Join Date: Jan 2010

 
DONATE TO ME
Lightbulb [APP] Bonnie++ for Android - Command Line Disk Benchmark

So here is the command line disk benchmark tool Bonnie++.

Now you can test all of your cfq, bfq or whatever IO scheduler with a standard unix benchmark tool.

Builds with ndk-build.

Bonnie++ recommends/uses disk space twice as big as your RAM is, although you can circumvent this with "-r 0 -s <size(MiB)>". So use a partition with more than 1.6 GB space.

Running the benchmark takes quite a while depending on IO speed, filesystem type and test size (~90 minutes).

Here is a run with the Samsung Galays S2, my kernel (Backslash-1.3), on the vfat filesystem with the noop IO scheduler:
Code:
# cd /sdcard
# mkdir tt
# /data/local/bin/bonnie -u 0:0 -d tt
Using uid:1000, gid:1015.
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
Reading a byte at a time...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
localhost     2047M    14  97  7336  22  5796  23   229  97 36143  33 301.6  46
Latency               791ms    8633ms    7713ms   73542us   51512us    2342ms
Version  1.96       ------Sequential Create------ --------Random Create--------
localhost           -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16    11  84 22008  97    38  52    11  85 30837  97    21  74
Latency              1025ms    3926us     162ms     316ms    8814us     358ms
1.96,1.96,localhost,1,1310695590,2047M,,14,97,7336,22,5796,23,229,97,36143,33,301.6,46,16,,,,,11,84,22008,97,38,52,11,85,30837,97,21,74,791ms,8633ms,7713ms,73542us,51512us,2342ms,1025ms,3926us,162ms,316ms,8814us,358ms
# rmdir tt
If you run out of disk space, you will get an error message like this:
Code:
Can't write block.: No such file or directory
Can't write block 218481.
Have fun testing and report your scores, along with the phone, kernel, filesystem type and IO scheduler settings.

DISCLAIMER: writing a lot on flash might degrade the lifetime of the device.

HTC ONE GE, Nexus 7 (2002), Nexus 10 bitcoin:1Q9gkB1FWPu1xBxCNJx3NkZ66r2BQrFbGv
The Following 3 Users Say Thank You to saturn_de For This Useful Post: [ Click to Expand ]
 
saturn_de
Old
#2  
saturn_de's Avatar
Senior Member - OP
Thanks Meter 148
Posts: 140
Join Date: Jan 2010

 
DONATE TO ME
Here is a run with the Samsung Galays S2, my kernel (Backslash-1.3), on the ext4 filesystem with the noop IO scheduler. I had to limit the test size to 1024MB, which might explain the better numbers.

Code:
# cd /data/local
# mkdir tt
# /data/local/bin/bonnie -u 0:0 -r 0 -s 1024 -d tt
Code:
Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
localhost        1G    10  96  7391  22  6056  21   193  97 37688  32 483.0  65
Latency               907ms   12169ms    9516ms     112ms   44923us   39518us
Version  1.96       ------Sequential Create------ --------Random Create--------
localhost           -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16   210  94 +++++ +++  4129  69   218  95 +++++ +++   612  71
Latency               332ms    2115us    3736us     191ms    2624us    1260ms
1.96,1.96,localhost,1,1310697921,1G,,10,96,7391,22,6056,21,193,97,37688,32,483.0,65,16,,,,,210,94,+++++,+++,4129,69,218,95,+++++,+++,612,71,907ms,12169ms,9516ms,112ms,44923us,39518us,332ms,2115us,3736us,191ms,2624us,1260ms

HTC ONE GE, Nexus 7 (2002), Nexus 10 bitcoin:1Q9gkB1FWPu1xBxCNJx3NkZ66r2BQrFbGv
 
zeppelinrox
Old
#3  
zeppelinrox's Avatar
Senior Member
Thanks Meter 20451
Posts: 9,209
Join Date: Dec 2010
Location: IN THE FREAKIN' OP

 
DONATE TO ME
Nice.
I will give this a try.
Tho 90 minutes is a long time.

Approximately how long would testing 100 mb take if I do -r 0 -s 100?
 
PacoBell
Old
#4  
Member
Thanks Meter 1
Posts: 50
Join Date: Sep 2006
Default Kingston SDC10/16GB on CM7.1 nightly Nexus One

Here is a run with the AT&T Nexus One, my kernel (2.6.37.6-cyanogenmod-g0799e00 android@portatile #1), on the vfat filesystem with the default scheduler:
Code:
Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
localhost        1G   135  67  3076   2  1577   1   369  60 13943   7  43.4   7
Latency               709ms   10044ms   14040ms    1171ms    6835ms    6572ms
Version  1.96       ------Sequential Create------ --------Random Create--------
localhost           -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16    15  41    39  33    15  14    20  55    55  91     7  15
Latency              6307ms    2152ms   23390ms    2924ms     552ms   14776ms
1.96,1.96,localhost,1,1323847739,1G,,135,67,3076,2,1577,1,369,60,13943,7,43.4,7,16,,,,,15,41,39,33,15,14,20,55,55,91,7,15,709ms,10044ms,14040ms,1171ms,6835ms,6572ms,6307ms,2152ms,23390ms,2924ms,552ms,14776ms
You can find my results from a cruder benchmark here.
 
lagittaja
Old
#5  
lagittaja's Avatar
Senior Member
Thanks Meter 17
Posts: 145
Join Date: Jan 2011
Heres my result
HTC Desire CyanogenMod 7.1.0 stable and apparently stock kernel that comes with it.
Transcend 8gigabyte microSDHC class 6
http://pastebin.com/dr32gQaq
 
PacoBell
Old
#6  
Member
Thanks Meter 1
Posts: 50
Join Date: Sep 2006
Default Sandisk SU32G "class 4" on Nexus One CM7 nightly build #253

Same environment, different card, vfat
Code:
# /data/local/bin/bonnie -u 0:0 -d tt
Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
localhost        1G   194  90  3477   2  2584   2   583  94 18680   9 268.3  19
Latency             78399us    3341ms   10149ms   41076us    1055ms    2667ms
Version  1.96       ------Sequential Create------ --------Random Create--------
localhost           -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16    26  70    55  92    86  43    28  75    65  89    31  67
Latency              1369ms   93566us     129ms    1358ms     106ms     240ms
1.96,1.96,localhost,1,1325570028,1G,,194,90,3477,2,2584,2,583,94,18680,9,268.3,19,16,,,,,26,70,55,92,86,43,28,75,65,89,31,67,78399us,3341ms,10149ms,41076us,1055ms,2667ms,1369ms,93566us,129ms,1358ms,106ms,240ms
Now on ext3 (I had to convert from ext4 to migrate my data from the old card...long story)
Code:
# /data/local/bin/bonnie -u 0:0 -d tt
Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
localhost        1G   167  95  3668   1  3079   2   735  96 18675   9 305.1  22
Latency             81970us    4741ms    4448ms   18616us     961ms    2439ms
Version  1.96       ------Sequential Create------ --------Random Create--------
localhost           -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  7668  46 +++++ +++ 18070  66 12862  75 +++++ +++ 18119  67
Latency              2043us    1862us    6011us    4425us    1038us    1861us
1.96,1.96,localhost,1,1325589434,1G,,167,95,3668,1,3079,2,735,96,18675,9,305.1,22,16,,,,,7668,46,+++++,+++,18070,66,12862,75,+++++,+++,18119,67,81970us,4741ms,4448ms,18616us,961ms,2439ms,2043us,1862us,6011us,4425us,1038us,1861us
Just curious, if we wanted to test "raw" performance, I suppose we would use the -b flag to bypass write buffering?

Here is the same ext3 test as above, but unbuffered
Code:
# /data/local/bin/bonnie -u 0:0 -b -d tt
Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
localhost        1G   168  96  3793   1  3026   2   731  96 19506   9 281.7  21
Latency             71411us    3354ms    4748ms   25146us     227ms    3275ms
Version  1.96       ------Sequential Create------ --------Random Create--------
localhost           -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16   259   3 +++++ +++   331   4   237   4 +++++ +++   269   3
Latency               698ms   10163us     361ms     766ms    1159us     178ms
1.96,1.96,localhost,1,1325588933,1G,,168,96,3793,1,3026,2,731,96,19506,9,281.7,21,16,,,,,259,3,+++++,+++,331,4,237,4,+++++,+++,269,3,71411us,3354ms,4748ms,25146us,227ms,3275ms,698ms,10163us,361ms,766ms,1159us,178ms
 
ricebowl2006
Old
#7  
Junior Member
Thanks Meter 0
Posts: 2
Join Date: Apr 2012
Default trouble

I was wondering if yall could help me get bonnie built.

I have android sdk and downloaded and untarred android ndk.

I untar bonnie++ and in the untared directory i run build-ndk, but it gives me:

Android NDK: Your APP_BUILD_SCRIPT points to an unknown file:
and it gives the path to the Android.mk file.

Do you guys know whats wrong??
 
ricebowl2006
Old
#8  
Junior Member
Thanks Meter 0
Posts: 2
Join Date: Apr 2012
Can someone post a walkthrough on how to build this and get it on my phone please?
 
JugglerLKR
Old
(Last edited by JugglerLKR; 9th January 2013 at 12:54 PM.)
#9  
Senior Member
Thanks Meter 7
Posts: 248
Join Date: Jul 2007
Location: Moscow

 
DONATE TO ME
Gives me permission denied on rooted 4.1.2. Is there a fix?
I will answer myself - you have to make it executable and put somewhere to /data/local
 
pkasula
Old
(Last edited by pkasula; 16th April 2013 at 10:16 PM.)
#10  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Apr 2013
Default bonnie++ file not working

Hello,

Its my first time with tools. I tried to save as the precompiled file in my phone but it got directly downloaded. So I changed the extension afterwards to .exe. When i tried to copy it in data/local/ it gives me no permission error. So I tried to run the command ( with the path i downloaded bonnie) in terminal emulator, it doesnot work.

Kindly help me with this.

Thanks

Tags
benchmark, bonnie, disk
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...