Difference between revisions of "Application Notes: eMMC lifetime optimization"

From Compulab Mediawiki
Jump to: navigation, search
imported>Igor.vaisbein
(No difference)

Revision as of 14:10, 12 June 2019

Introduction

Flash memory devices have limited endurance that is measured in program-erase (P/E) cycles. P/E cycle is a sequence of events in which data is written to solid-state flash memory cell, then erased, and then rewritten. Typical eMMC endurance is 3000 P/E cycles. Problems with storage can negatively affect performance and reliability of the device. It is highly important to take into consideration eMMC endurance during embedded system development. Standard operating systems and file-systems typically are not configured for eMMC lifetime optimization. It is recommended to employ the techniques outlined below in order to configure the system for optimized eMMC usage.

Recommendations for eMMC lifetime optimization

Use tmpfs

Use tmpfs to store temporary files. Tmpfs is a temporary file storage facility on Unix-like systems stored in RAM. It helps to reduce unnecessary writes to the eMMC.
To mount temporary directories as tmpfs add the following entries into the system /etf/fstab:

tmpfs   /tmp       tmpfs   defaults,noatime,mode=1777   0 0
tmpfs   /var/tmp   tmpfs   defaults,noatime,mode=1777   0 0

Turn off logging

Turn off or reduce logging. Writing or removing big amounts of data on a regular basis significantly decreases eMMC lifetime.
Turning off the syslog on boot should be done with following command:

systemctl disable syslog

To mount logging as tmpfs add the following entry into the system /etf/fstab:

tmpfs   100M  596K  100M   1% /var/log

Turn off logging of read access times. To do this add the following entry into the system /etf/fstab:

/dev/sdxxxxxx / ext4 discard,noatime,errors=remount-ro 0 1

Do not use swap space

Do not use swap space. Swapping uses internal storage intensively and should be minimized or disabled to increase eMMC lifetime.

Decreasing swap usage should be done with following command:

vm.swappiness=10

Disabling swap usage should be done with following command:

vm.swappiness=0

Use SquashFS

SquashFS is a compressed file-system that is intended for read-only usage.