Hardware / Linux : optimize SdCard (nand flash) speed and lifetime

I recently created a new NAS server using a sheevaplug (article to come…) and a 8Gb Sdcard for the system partition.

Maybe you know that partitioning and formatting sdcard should be done carefully to get best speed and lifetime. This require to respect the both erasure block and segment size : this is exactly what I made and what is this article about.

I used the “flashbench tool” from : https://github.com/bradfa/flashbench.

Usage

 

Note that I sometime need top launch it several times to get consistent values (eg: non negative time).
Based on the flashbench author’s explanation, I could find:

  • erasure block : biggest value for which the time become near the double of the previous one. In my case it was 4Mb
  • segment size (block size) : smallest value for which the time become significantly higher than the previous one. For me : 4k

Then, simply calculate all the needed informations to partition with fdisk and format with ext4. I made  an  M$ Excel sheet to define parameters for every SDCard I use (file is attached to this post)… Note that I commented out the file for easier usage… 😉

flash memory settings calculator

Small benchmarks

For Bigfiles :

 

Before optimization I got : 18.2 and after I had 21.9. Ok, that’s not so much, but look further for small files…

For small files:

 

Before optimization, I got 148 Mb/s and after : 184 Mb/s !

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.