How long is the service life of solid state drive SSD?

Story prequel

Under the deep night sky, stars are like twinkling lights, dotted in the boundless universe. Against the background of this mysterious night sky, Xiao Zhang, a computer enthusiast who loves to explore the unknown, is full of endless curiosity about his computer world.

Xiao Zhang's computer is like his friend, spending time with him day and night. Among them, an SSD hard drive is his precious treasure, because it contains his years of hard work, a large number of photos, videos, design files, and countless days and nights of adventures he and his friends took in the virtual world.

However, Xiao Zhang recently discovered that his SSD's life was about to expire. He began to worry that if the SSD's lifespan expired, would his data disappear? Does he need to buy a new hard drive? Can his data be recovered? A series of questions troubled him.

In this article, we will answer Xiao Zhang’s questions

What is the storage medium of SSD? It is NAND flash memory. So do you know how NAND flash memory works? In fact, it is composed of many transistors. These transistors store charges inside them, which represent our binary data, either "0" or "1". In principle, NAND flash memory is a CMOS tube with two gates, one is the control gate (Control Gate) and the other is the floating gate (Floating Gate). The function of the floating gate is to store charges, and there is a gap between the floating gate and the channel. The quality of the oxide layer (Oxide Layer) determines the reliability of the floating gate storage charge, which is the life of the NAND flash memory.

However, the charge in these transistors does not exist permanently. They are like a group of naughty children who like to run around. If you often let them perform "erase" and "write" operations (in NAND flash memory, P/E Cycle, also called the number of erases), they will feel tired and their charge storage capacity will gradually decrease ( The oxide layer between the floating gate and the channel is becoming more and more worn, making it increasingly difficult to control electrons in the floating gate). Until one day, they no longer want to store charge. At that time, the life of your SSD is almost over.

Therefore, the underlying mechanism of SSD life evaluation is actually to calculate the number of erase and write times (P/E Cycle) of NAND flash memory. Each transistor has a fixed number of erases and writes, just like our legs, they will get tired and worn out if they run too much. When these transistors reach a certain level of wear, they can no longer store charge, and your SSD is about to retire!

Currently, there are four main NAND types circulating on the market: SLC, MLC, TLC, and QLC. With each life span from high to low, the order is SLC>MLC>TLC>QLC.

As a single cell contains more bits, the reliability of NAND will decrease. At the same time, write latency is also increasing. SLC write latency is at the 0.5ms level, while QLC write latency reaches 10-20ms, a 40-fold difference.

There are two main indicators for SSD life evaluation: DWPD (Drive Writes Per Day) and TBW (Total Bytes Written).

DWPD, which is the amount of data that can be written to the SSD per day, is one of the important indicators for measuring the life of the SSD. Generally speaking, the larger the DWPD, the longer the life of the SSD. The calculation formula of DWPD is:

DWPD = (Flash P/E cycle × SSD capacity) ÷ Annual written data volume

Among them, the flash P/E cycle is the number of times that the basic storage unit (floating gate transistor) of NAND flash memory can be erased and programmed. This value depends on the specifications of the NAND flash memory and the manufacturer's regulations. SSD capacity indicates the size of its storage space. The amount of data written annually depends on the user's usage.

Another evaluation metric is TBW, which is the total amount of written data that the SSD can withstand during its life cycle. The calculation formula of TBW is:

TBW = (number of programmable times per sector × total number of SSD sectors × number of writes per day) ÷ number of programmable times per sector

Among them, the number of programmable times per sector refers to the number of times each memory block (Block) can be programmed. This value depends on the specifications of the NAND flash memory and the manufacturer's regulations. The total number of sectors in the SSD represents the total number of sectors in its internal storage structure. The number of writes per day is based on user usage.

DWPD and TBW are both indicators used to measure the life of SSD. DWPD focuses more on the frequency of daily use, while TBW focuses on the total write capacity of the hard drive. Generally speaking, the larger the DWPD, the larger the TBW, and the longer the life of the SSD. However, these indicators are only reference values ​​for evaluating SSD life. The actual service life is also affected by other factors, such as workload, ambient temperature, SSD writing strategy, etc.

How to check SSD lifespan?

How to get the lifespan under windows: use CrystalDiskinfo

How Linux obtains the smart disk SSD: "percentage_used" is the proportion of used life specified by the nvme protocol.

nvme smart-log /dev/nvme0n1

Smart Log for NVMe device '/dev/nvme0n1'  
critical_warning : 0  
temperature : 48 [Celsius]  
available_spare : 100%  
available_spare_threshold : 10%  
percentage_used : 0%  
data_units_read : 1,665,234 [GB]  
data_units_written : 463,676 [GB]  
host_read_commands : 2,611,299,337  
host_write_commands : 1,166,374,448  
controller_busy_time : 0 [ms]  
power_cycle_count : 177  
warning_timer_count : 0  
power_off_count : 0  
shutdown_count : 0  
data_units_read_power_cycle_count : 1,190  
data_units_written_power_cycle_count : 942  
data_units_read_warning_timer_count : 0  
data_units_written_warning_timer_count : 0

sata ssd can be obtained using smartctl -l devstat, where "Percentage Used Endurance Indicator" represents the proportion of service life


Device Statistics (GP Log 0x04)
Page Offset Size         Value  Description
   1  =====  =                =  == General Statistics (rev 2) ==
   1  0x008  4                3  Lifetime Power-On Resets
   1  0x010  4                0  Power-on Hours
   1  0x018  6                0  Logical Sectors Written
   1  0x020  6            32768  Number of Write Commands
   1  0x028  6              432  Logical Sectors Read
   1  0x030  6            32780  Number of Read Commands
   4  =====  =                =  == General Errors Statistics (rev 1) ==
   4  0x008  4                0  Number of Reported Uncorrectable Errors
   4  0x010  4                0  Resets Between Cmd Acceptance and Completion
   6  =====  =                =  == Transport Statistics (rev 1) ==
   6  0x008  4                6  Number of Hardware Resets
   6  0x010  4                0  Number of ASR Events
   6  0x018  4                0  Number of Interface CRC Errors
   7  =====  =                =  == Solid State Device Statistics (rev 1) ==
   7  0x008  1                0  Percentage Used Endurance Indicator

Of course, the life of SSD will also be affected by other factors, such as write amplification, working environment, workload, etc. Therefore, when we evaluate the life of SSD, we must also consider these factors comprehensively.

Among them, to understand some amplification, we need to first understand the reading and writing mechanism of solid-state drives. We know that the storage unit of a solid-state drive is composed of flash memory particles, and physical data coverage cannot be achieved. It can only be erased and then written, and the process is repeated. Therefore, we can imagine that in the actual reading and writing process, data reading and writing will inevitably require multiple erasing and writing on the flash memory particles, especially when some blocks are completely filled.


The ratio of the increased number of writes to the original number of writes required for these multiple operations is the so-called write amplification. Therefore, a high write amplification value will shorten the life of the solid state drive. (SSD flash memory particles have a rated P/E value, that is, the maximum number of reads and writes, high write amplification, fast P/E loss, and low lifespan.) In QLC media, the impact of WAF is even more fatal.

For example, in the worst case scenario, if I want to write a 4KB data Z to cover A, and there happens to be no free page area in the target block, GC recycling is required. At this time, it is necessary to move all five data B, C, D, E, and F, and then erase the entire data block. After the erasure is completed, the entire 6 data pages are written. During this entire process, although the Host only wrote 4KB of data, in the actual process, due to GC issues, the NAND ended up writing 24KB. Then write amplification WAF=24KB/4KB=6.


There are many factors that affect WAF:

  • The design of SSD FTL algorithm affects the size of write amplification
  • Wear Leveling, WL wear leveling: This mechanism mainly extends the overall service life by balancing all flash memory particles, but it still increases the overall write amplification
  • Over-Provisioning, OP redundant space: also affects the proportion of NAND writes, ultimately affecting write amplification
  • Garbage Collection, GC garbage collection: For example, in the above example, GC garbage collection moves data, and writing after erasing data blocks brings about an overall improvement in write amplification.
  • Data model for business reading and writing: Random writing and sequential writing have a great impact on the write ratio of NAND, directly affecting the write amplification coefficient.
  • TRIM operation at the system level: It will affect whether invalid data is relocated during the GC process, and also plays an important role in write amplification.

Write amplification WAF is a key parameter for NAND-based SSD life consumption. The larger the WAF, the faster the life consumption. The closer to 1, the slower the life consumption, which is also the most ideal situation.

So, can the SSD continue to be used after its lifespan expires? Although the life of SSD is mainly predicted based on the number of erasing and writing of flash memory cells, the actual situation will not develop exactly as predicted. Even if an SSD reaches the end of its life, its storage cells may still be intact and can continue to be used. In addition, SSD has numerous data protection mechanisms. When the life of the SSD is expected to expire, the SSD will enter a self-protection state, reduce the amount of writing, slow down the number of erases and writes, thereby extending the service life. Therefore, even if the life of the SSD expires, users can continue to use it. However, the performance of the SSD may be reduced and data reliability will be affected at this time, so it is recommended to replace the SSD in time.

Guess you like

Origin blog.csdn.net/zhuzongpeng/article/details/132748349