简体   繁体   中英

SD card throughput on Linux machine

I'm trying to run a custom application on an embedded Linux platform (Linux 4.1). This application writes 1 MB of data continuously to the SD card (Sandisk UHS I class). The application uses an fwrite() call to write the data to the SD card.

Below are my observations when the SD card write throughput was monitored.

  1. The average throughout is around 10 Mbytes per sec.
  2. The instantaneous throughput (measured per 1 MB transfer) drops after every 50 MB data is written. The throughput drops as low as 200kbytes per sec.
  3. I have tried using write() system call instead of fwrite() , with O_SYNC flag set. With this, the instantaneous throughput has increased to 1MBps.

The SD card spec says the minimum throughput supported is 10 MBps. Why does the instantaneous throughput drop?

Is this behaviour expected? What is limiting the instantaneous throughput?

My application requires minimum instantaneous throughput of 4MBps. What should I do?

  1. Make sure that the interface and the driver connecting your embedded linux device with the SD-card supports the throughput. (Eg when it's connected via "Bitbanging" the throughput could be much less than what you expect).
  2. Test the throughput with a well known tool (dd) and flush the cache before: sync; echo 3 | sudo tee /proc/sys/vm/drop_caches dd if=/dev/zero of= bs=500K count=2024
  3. And finally please refer to: https://raspberrypi.stackexchange.com/questions/32884/why-does-the-sd-card-random-write-performance-for-record-size-8-128-kb-drops-bel

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM