[Flashbench] USB Stick: 8GB SanDisk Cruzer Micro (2008)

Arnd Bergmann arnd at arndb.de
Sun Apr 24 14:59:27 UTC 2011


On Sunday 24 April 2011 13:44:53 Sitsofe Wheeler wrote:
> I'm not really sure how to generate useful results so here's what I've
> got so far:

There is a README file which should give you some background.
The other information that would be nice to get is the exact size in KB
(from /proc/partitions or from fdisk -lu /dev/sdb), and most importantly
the results from the --open-au test run.

> # lsusb
> Bus 001 Device 004: ID 0781:5151 SanDisk Corp. Cruzer Micro Flash Drive
> 
> # ./flashbench -a /dev/sdb --blocksize=1024 
> align 2147483648	pre 687µs	on 599µs	post 495µs	diff 7.44µs
> align 1073741824	pre 635µs	on 657µs	post 499µs	diff 90.3µs
> align 536870912	pre 601µs	on 634µs	post 495µs	diff 86.1µs
> align 268435456	pre 602µs	on 635µs	post 490µs	diff 89.5µs
> align 134217728	pre 621µs	on 638µs	post 496µs	diff 79.5µs
> align 67108864	pre 602µs	on 636µs	post 509µs	diff 80.4µs
> align 33554432	pre 606µs	on 622µs	post 494µs	diff 71.8µs
> align 16777216	pre 614µs	on 625µs	post 498µs	diff 69.3µs
> align 8388608	pre 602µs	on 620µs	post 490µs	diff 73.2µs
> align 4194304	pre 601µs	on 637µs	post 508µs	diff 83µs
> align 2097152	pre 601µs	on 653µs	post 495µs	diff 106µs
> align 1048576	pre 494µs	on 584µs	post 511µs	diff 81.5µs
> align 524288	pre 491µs	on 510µs	post 495µs	diff 17µs
> align 262144	pre 491µs	on 511µs	post 494µs	diff 18.2µs
> align 131072	pre 493µs	on 510µs	post 494µs	diff 16.3µs
> align 65536	pre 495µs	on 513µs	post 494µs	diff 18.8µs
> align 32768	pre 490µs	on 511µs	post 489µs	diff 21.6µs
> align 16384	pre 493µs	on 511µs	post 494µs	diff 17.9µs
> align 8192	pre 511µs	on 514µs	post 495µs	diff 11µs
> align 4096	pre 538µs	on 530µs	post 496µs	diff 12.9µs
> align 2048	pre 506µs	on 515µs	post 513µs	diff 5.52µs

It's rather clear from this run that the erase block size is 1 MB, which is the
poin the the last column where the numbers get drastically lower. For all
other tests, you should pass --erasesize=1048576, otherwise flashbench
will assume an incorrect value of 4 MB.

> # ./flashbench -f /dev/sdb
> 4MiB    7.41M/s  7.35M/s  7.37M/s  7.33M/s  7.47M/s  7.39M/s  
> 2MiB    7.37M/s  7.38M/s  7.42M/s  7.3M/s   7.1M/s   4.45M/s  
> 1MiB    7.21M/s  7.06M/s  7.05M/s  7.07M/s  7.14M/s  7.22M/s  
> 512KiB  6.97M/s  6.93M/s  6.92M/s  6.79M/s  6.95M/s  6.95M/s  
> 256KiB  7M/s     6.82M/s  6.95M/s  6.89M/s  7.02M/s  6.71M/s  
> 128KiB  7.51M/s  7.8M/s   7.64M/s  7.43M/s  7.6M/s   7.6M/s   
> 64KiB   10.4M/s  10.2M/s  10.1M/s  10.1M/s  10.1M/s  10.2M/s  
> 32KiB   4.53M/s  4.55M/s  4.48M/s  4.53M/s  4.47M/s  4.45M/s  
> 16KiB   3.77M/s  3.73M/s  3.75M/s  3.75M/s  3.74M/s  3.75M/s 
> 
> A further question is how do I use these results so as to get good
> performance? Should I be setting the first partition in any particular
> way and/or passing any special options to mkfs.vfat?

Most importantly, you should align each partition to full multiples
of 1 MB. You can also see here that 64 KB writes are much faster than
smaller ones, so you should use 64 KB clusters if possible, this would
mean mkdosfs -s 128.

As the next step, please run 

./flashbench --open-au /dev/sdb --erasesize=1048576 --blocksize=2048 --random --open-au-nr=2

and then do the same with larger values for --open-au-nr= until you
get to the point where the drive gets drastically slower. The number
you are looking for is the last value for --open-au-nr= that is still
fast.

Once you are there, try the same without --random to see if the cutoff
is at the same point. It usually is, so you'd only have to try the highest
fast one and the lowest slow one from the --random test.

For completeness, please rerun the -f test with these parameters:

flashbench -f /dev/sdb --erasesize=1048576 --blocksize=512 --random

The blocksize in these tests is only the point where the test stops
trying smaller numbers. If it gets really slow (< 100K/s), feel free
to interrupt at any time and post only the results that you already got.

	Arnd



More information about the Flashbench-results mailing list