Hi again,
I've tested another SDHC card. But this time it was a class-4 mini-SDHC with 8GB.
The card is a very cheap one from the German drugstore DM. (No, usually I do not buy my electronics in drugstores ;-) - just a backup card.)
Ok, here are the results. I'm not sure, if my interpretation of them is right.
I've read, that the choice of the underlaying filesystem depends on the amount of open erase blocks.
Is there any rule of best practice for choosing the right filesystem for a particular sd card?
Some feedback would be nice!
Bye, Holger
$ fdisk -l /dev/sdc
Disk /dev/sdc: 7948 MB, 7948206080 bytes
255 heads, 63 sectors/track, 966 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
$ ./flashbench -a /dev/sdc --blocksize=1024
align 2147483648 pre 825µs on 1.19ms post 851µs diff 347µs
align 1073741824 pre 841µs on 1.18ms post 830µs diff 341µs
align 536870912 pre 821µs on 1.14ms post 779µs diff 341µs
align 268435456 pre 842µs on 1.18ms post 818µs diff 346µs
align 134217728 pre 832µs on 1.16ms post 799µs diff 346µs
align 67108864 pre 860µs on 1.16ms post 822µs diff 321µs
align 33554432 pre 832µs on 1.15ms post 802µs diff 331µs
align 16777216 pre 783µs on 1.16ms post 824µs diff 359µs
align 8388608 pre 807µs on 1.1ms post 781µs diff 303µs
align 4194304 pre 817µs on 1.14ms post 786µs diff 340µs
align 2097152 pre 847µs on 924µs post 791µs diff 105µs
align 1048576 pre 791µs on 935µs post 807µs diff 136µs
align 524288 pre 826µs on 906µs post 823µs diff 81.9µs
align 262144 pre 810µs on 926µs post 826µs diff 108µs
align 131072 pre 832µs on 913µs post 801µs diff 96.5µs
align 65536 pre 819µs on 922µs post 830µs diff 97.2µs
align 32768 pre 831µs on 941µs post 807µs diff 122µs
align 16384 pre 772µs on 918µs post 820µs diff 122µs
align 8192 pre 798µs on 845µs post 837µs diff 27µs
align 4096 pre 794µs on 823µs post 806µs diff 22.2µs
align 2048 pre 836µs on 850µs post 801µs diff 31.7µs
## Looks like 4MB erase blocksize and 16KB page size??
$ ./flashbench /dev/sdc --open-au --erasesize=$[4*1024*1024] --blocksize=$[4*1024] --random --open-au-nr=1
4MiB 5.41M/s
2MiB 8.97M/s
1MiB 5.98M/s
512KiB 17.1M/s
256KiB 10.9M/s
128KiB 4.25M/s
64KiB 2.13M/s
32KiB 1.06M/s
16KiB 545K/s
8KiB 2.07M/s
4KiB 1.76M/s
$ ./flashbench /dev/sdc --open-au --erasesize=$[4*1024*1024] --blocksize=$[4*1024] --random --open-au-nr=2
4MiB 8.21M/s
2MiB 5.75M/s
1MiB 18.5M/s
512KiB 16.8M/s
256KiB 10.7M/s
128KiB 4.26M/s
64KiB 2.11M/s
32KiB 1.06M/s
16KiB 545K/s
8KiB 2.05M/s
4KiB 1.69M/s
$ ./flashbench /dev/sdc --open-au --erasesize=$[4*1024*1024] --blocksize=$[4*1024] --random --open-au-nr=3
4MiB 9.18M/s
2MiB 19.1M/s
1MiB 18.7M/s
512KiB 16.5M/s
256KiB 10.8M/s
128KiB 4.23M/s
64KiB 2.11M/s
32KiB 1.06M/s
16KiB 544K/s
8KiB 1.99M/s
4KiB 1.67M/s
$./flashbench /dev/sdc --open-au --erasesize=$[4*1024*1024] --blocksize=$[4*1024] --random --open-au-nr=4
4MiB 10.6M/s
2MiB 19.3M/s
1MiB 18.6M/s
512KiB 16.6M/s
256KiB 10.9M/s
128KiB 4.24M/s
64KiB 2.11M/s
32KiB 1.06M/s
16KiB 544K/s
8KiB 1.86M/s
4KiB 1.53M/s
$ ./flashbench /dev/sdc --open-au --erasesize=$[4*1024*1024] --blocksize=$[4*1024] --random --open-au-nr=5
4MiB 6.1M/s
2MiB 6.68M/s
1MiB 4.39M/s
512KiB 2.96M/s
256KiB 1.95M/s
128KiB 1.02M/s
64KiB 570K/s
32KiB 334K/s
16KiB 167K/s
8KiB 1M/s
4KiB 1.14M/s
$ ./flashbench /dev/sdc --open-au --erasesize=$[4*1024*1024] --blocksize=$[4*1024] --random --open-au-nr=6
4MiB 7.5M/s
2MiB 4.69M/s
1MiB 3.38M/s
512KiB 2.02M/s
256KiB 1.22M/s
128KiB 688K/s
64KiB 406K/s
^C
## Looks like 4.
$./flashbench /dev/sdc -f --erasesize=$[4*1024*1024]
4MiB 4.11M/s 17.4M/s 16.9M/s 5.62M/s 5.18M/s 5.2M/s
2MiB 5.02M/s 17.6M/s 17.2M/s 5.32M/s 5.03M/s 5.21M/s
1MiB 5.28M/s 17.2M/s 17.2M/s 5.53M/s 5.21M/s 5M/s
512KiB 5.04M/s 17.4M/s 5.07M/s 5.21M/s 5.27M/s 5.01M/s
256KiB 5.19M/s 17.1M/s 5.02M/s 5.21M/s 5.02M/s 5.21M/s
128KiB 2.35M/s 16.6M/s 4.96M/s 5.22M/s 4.99M/s 5.18M/s
64KiB 4.98M/s 16.6M/s 5.21M/s 4.91M/s 4.97M/s 5.21M/s
32KiB 2.31M/s 14.8M/s 5.11M/s 4.92M/s 5.12M/s 5.2M/s
16KiB 4.81M/s 12.4M/s 5.07M/s 5M/s 5M/s 4.82M/s
## Looks like the second and the third block were faster than the others.
Hi,
I'm new to the topic of flash benchmarking. I came across reading several articles about this topic, like these in the German Linux Magazin, issue 07/12 and Arnd's linked article on lwn.
I'm currently playing around with a Raspberry Pi that needs a SD card to boot from. (first partition FAT32 for the kernel, second something like ext3/ext4 for the rootfs). I would like to
get the 'best' perfomance out of it, so I also had a look at the flashbench tool. I made some tests with my 32GB Transcend SDHC card and found out, that the card has a 8MB erase block size
and 8KB pages and can handle up to 5 open-au's. (results are listed below)
So what next?
The next step for me is to find out, how to align the partitions correctly. I already talked to Andrew (thx! I was wrong with the erase block size.) who send me the following link that points
to a script that creates two partitions and aligns them correctly.
Is there anything else I can do? ...or am I wrong?
Bye, Holger
--
$ fdisk -l /dev/sdc
Disk /dev/sdc: 32.5 GB, 32462864384 bytes
64 Köpfe, 32 Sektoren/Spur, 30959 Zylinder, zusammen 63404032 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c0bcb
$ ./flashbench -a /dev/sdc --blocksize=1024
align 8589934592 pre 1.04ms on 1.59ms post 1.32ms diff 402µs
align 4294967296 pre 1.04ms on 1.67ms post 1.33ms diff 485µs
align 2147483648 pre 1.03ms on 1.64ms post 1.31ms diff 468µs
align 1073741824 pre 1.02ms on 1.48ms post 1.33ms diff 309µs
align 536870912 pre 1.02ms on 1.5ms post 1.35ms diff 320µs
align 268435456 pre 1.02ms on 1.49ms post 1.28ms diff 338µs
align 134217728 pre 1.02ms on 1.49ms post 1.34ms diff 314µs
align 67108864 pre 1.04ms on 1.48ms post 1.27ms diff 332µs
align 33554432 pre 1.01ms on 1.5ms post 1.32ms diff 330µs
align 16777216 pre 1.04ms on 1.5ms post 1.28ms diff 347µs
align 8388608 pre 995µs on 1.51ms post 1.31ms diff 354µs
align 4194304 pre 1.02ms on 1.35ms post 1.3ms diff 189µs
align 2097152 pre 1.05ms on 1.39ms post 1.31ms diff 209µs
align 1048576 pre 1.04ms on 1.37ms post 1.29ms diff 203µs
align 524288 pre 1.02ms on 1.36ms post 1.32ms diff 192µs
align 262144 pre 1.01ms on 1.33ms post 1.31ms diff 176µs
align 131072 pre 1.03ms on 1.35ms post 1.31ms diff 182µs
align 65536 pre 1.01ms on 1.33ms post 1.26ms diff 195µs
align 32768 pre 1.04ms on 1.37ms post 1.29ms diff 203µs
align 16384 pre 1.04ms on 1.36ms post 1.28ms diff 204µs
align 8192 pre 1.02ms on 1.3ms post 1.27ms diff 154µs
align 4096 pre 1.17ms on 1.16ms post 1.11ms diff 22.6µs
align 2048 pre 1.25ms on 1.24ms post 1.2ms diff 20.2µs
## For me it looks like 8MB erase block size and a 8KB page size. With that in mind, I made the following tests:
$ ./flashbench /dev/sdc --open-au --erasesize=$[8*1024*1024] --blocksize=$[8*1024] --open-au-nr=3 --random
8MiB 17M/s
4MiB 17.2M/s
2MiB 16.5M/s
1MiB 15.9M/s
512KiB 15M/s
256KiB 13.1M/s
128KiB 10.7M/s
64KiB 10.9M/s
32KiB 7.84M/s
16KiB 4.87M/s
8KiB 1.79M/s
$ ./flashbench /dev/sdc --open-au --erasesize=$[8*1024*1024] --blocksize=$[8*1024] --open-au-nr=4 --random
8MiB 17.4M/s
4MiB 17.1M/s
2MiB 16.8M/s
1MiB 16M/s
512KiB 15M/s
256KiB 13.4M/s
128KiB 10.8M/s
64KiB 10.9M/s
32KiB 7.89M/s
16KiB 4.87M/s
8KiB 1.79M/s
$ ./flashbench /dev/sdc --open-au --erasesize=$[8*1024*1024] --blocksize=$[8*1024] --open-au-nr=5 --random
8MiB 10.3M/s
4MiB 17.1M/s
2MiB 16.7M/s
1MiB 16.2M/s
512KiB 15M/s
256KiB 13.3M/s
128KiB 10.9M/s
64KiB 11M/s
32KiB 7.95M/s
16KiB 4.48M/s
8KiB 1.8M/s
$ ./flashbench /dev/sdc --open-au --erasesize=$[8*1024*1024] --blocksize=$[8*1024] --open-au-nr=6 --random
8MiB 13.4M/s
4MiB 4.27M/s
2MiB 2.26M/s
1MiB 1.2M/s
512KiB 621K/s
^C
## And this looks like 5 open-au in random mode.
$ ./flashbench /dev/sdc -f --erasesize=$[8*1024*1024]
8MiB 17.2M/s 17.8M/s 17.1M/s 17.8M/s 17.5M/s 17.5M/s
4MiB 16.9M/s 17.7M/s 17M/s 17.8M/s 17.5M/s 17.5M/s
2MiB 16.8M/s 17.6M/s 17M/s 17.6M/s 17.5M/s 17.4M/s
1MiB 16.7M/s 17.6M/s 17M/s 17.5M/s 17.4M/s 17.5M/s
512KiB 16.6M/s 17.2M/s 17.4M/s 17.1M/s 16.9M/s 16.5M/s
256KiB 16.4M/s 17M/s 17.2M/s 16.9M/s 16.6M/s 16.6M/s
128KiB 16.5M/s 16.2M/s 16.6M/s 16.3M/s 16.1M/s 16.1M/s
64KiB 16.5M/s 17.1M/s 16.4M/s 17.2M/s 17M/s 17M/s
32KiB 15.4M/s 16.3M/s 15.5M/s 16.1M/s 16M/s 16.1M/s
16KiB 13M/s 13.5M/s 13.2M/s 13.5M/s 13.5M/s 13.5M/s