Difference between revisions of "Application Notes: eMMC lifetime optimization"
imported>Igor.vaisbein m (Igor.vaisbein moved page Application Notes: eMMC endurance to Application Notes: eMMC lifetime optimization) |
imported>Igor.vaisbein |
||
Line 8: | Line 8: | ||
===Use tmpfs=== | ===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.</br> | 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.</br> | ||
− | To mount temporary directories as tmpfs add the following entries into the system '''/ | + | To mount temporary directories as tmpfs add the following entries into the system '''/etc/fstab''': |
<pre> | <pre> | ||
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0 | tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0 | ||
Line 21: | Line 21: | ||
</pre> | </pre> | ||
− | To mount logging as tmpfs add the following entry into the system '''/ | + | To mount logging as tmpfs add the following entry into the system '''/etc/fstab''': |
<pre> | <pre> | ||
tmpfs 100M 596K 100M 1% /var/log | tmpfs 100M 596K 100M 1% /var/log | ||
</pre> | </pre> | ||
− | Turn off logging of read access times. To do this add the following entry into the system '''/ | + | Turn off logging of read access times. To do this add the following entry into the system '''/etc/fstab''': |
<pre> | <pre> | ||
/dev/sdxxxxxx / ext4 discard,noatime,errors=remount-ro 0 1 | /dev/sdxxxxxx / ext4 discard,noatime,errors=remount-ro 0 1 |
Revision as of 12:22, 8 September 2019
Contents
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 /etc/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 /etc/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 /etc/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.