Difference between revisions of "SD Card Performance Benchmarking"
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Preparations= | =Preparations= | ||
get this http://vserver.13thfloor.at/Stuff/prng.c and build it with "-O3" | Note: Be aware that this will wipe/erase all data on the SD card we are benchmarking, also be extra careful to select the correct device/mount point to not wipe you PCs internal drive instead by accident. | ||
get this http://vserver.13thfloor.at/Stuff/prng.c and build it with "-O3": | |||
gcc prng.c -o prng -O3 | |||
copy 16 bytes from /dev/random into a file e.g. sd001.seed: | copy 16 bytes from /dev/random into a file e.g. sd001.seed: | ||
dd if=/dev/random of= | dd if=/dev/random of=sd001.seed bs=16b count=1 | ||
=Benchmark Write Speed= | =Benchmark Write Speed= | ||
run | run: | ||
./prng sd001.seed | dd of=/dev/sdXX bs=128k iflag=fullblock oflag=direct status=progress | ./prng sd001.seed | dd of=/dev/sdXX bs=128k iflag=fullblock oflag=direct status=progress | ||
where /dev/sdXX is the device for the SD card | where /dev/sdXX is the device for the SD card | ||
this should run for a while an write pseudo random data to the sd card | this should run for a while an write pseudo random data to the sd card: | ||
<pre class="code">15923412992 bytes (16 GB, 15 GiB) copied, 1415 s, 11,3 MB/s | |||
dd: error writing '/dev/mmcblk0': No space left on device | |||
121549+0 records in | |||
121548+0 records out | |||
15931539456 bytes (16 GB, 15 GiB) copied, 1415,66 s, 11,3 MB/s | |||
</pre> | |||
any errors there are a general problem except for when the sd card is full | any errors there are a general problem except for when the sd card is full | ||
once you know the number of blocks for | once you know the number of blocks (for theabove example: 121548) specific sd card you want to add count=xxx to avoid overrun | ||
./prng sd001.seed | dd of=/dev/sdXX bs=128k iflag=fullblock oflag=direct status=progress count=121548 | |||
=Benchmark Read Speed= | =Benchmark Read Speed= | ||
Line 26: | Line 34: | ||
the checksum can then be verified with: | the checksum can then be verified with: | ||
./prng sd001.seed | dd bs=128k count=xxx | md5sum | ./prng sd001.seed | dd bs=128k count=xxx iflag=fullblock | md5sum | ||
if the checksums do not match, the sd card is not keeping the data written | if the checksums do not match, the sd card is not keeping the data written |
Latest revision as of 14:30, 14 February 2021
1 Preparations
Note: Be aware that this will wipe/erase all data on the SD card we are benchmarking, also be extra careful to select the correct device/mount point to not wipe you PCs internal drive instead by accident.
get this http://vserver.13thfloor.at/Stuff/prng.c and build it with "-O3":
gcc prng.c -o prng -O3
copy 16 bytes from /dev/random into a file e.g. sd001.seed:
dd if=/dev/random of=sd001.seed bs=16b count=1
2 Benchmark Write Speed
run:
./prng sd001.seed | dd of=/dev/sdXX bs=128k iflag=fullblock oflag=direct status=progress
where /dev/sdXX is the device for the SD card
this should run for a while an write pseudo random data to the sd card:
15923412992 bytes (16 GB, 15 GiB) copied, 1415 s, 11,3 MB/s dd: error writing '/dev/mmcblk0': No space left on device 121549+0 records in 121548+0 records out 15931539456 bytes (16 GB, 15 GiB) copied, 1415,66 s, 11,3 MB/s
any errors there are a general problem except for when the sd card is full
once you know the number of blocks (for theabove example: 121548) specific sd card you want to add count=xxx to avoid overrun
./prng sd001.seed | dd of=/dev/sdXX bs=128k iflag=fullblock oflag=direct status=progress count=121548
3 Benchmark Read Speed
dd if=/dev/sdXX bs=128k iflag=direct count=xxx status=progress | md5sum
this will give a read performance and calculate a checksum
the checksum can then be verified with:
./prng sd001.seed | dd bs=128k count=xxx iflag=fullblock | md5sum
if the checksums do not match, the sd card is not keeping the data written