Write amplification

Uses your system voice; voice and rate in settings.

Snapshot

≈ 10 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

, thereby increasing writes on the drive and reducing its life. Write amplification (WA) is an undesirable phenomenon associated with flash memory and solid-state drives (SSDs) where the actual amount of information physically written to the storage media is a multiple of the logical amount intended to be written.

Because flash memory must be erased before it can be rewritten, with much coarser granularity of the erase operation when compared to the write operation, the process to perform these operations results in moving (or rewriting) user data and metadata more than once. Thus, rewriting some data requires an already-used-portion of flash to be read, updated, and written to a new location, together with initially erasing the new location if it was previously used.

Due to the way flash works, much larger portions of flash must be erased and rewritten than actually required by the amount of new data. This multiplying effect increases the number of writes required over the life of the SSD, which shortens the time it can operate reliably. The increased writes also consume bandwidth to the flash memory, which reduces write performance to the SSD. Many factors will affect the WA of an SSD; some can be controlled by the user and some are a direct result of the data written to and usage of the SSD.…

, thereby increasing writes on the drive and reducing its life. ]] Write amplification (WA) is an undesirable phenomenon associated with flash memory and solid-state drives (SSDs) where the actual amount of information physically written to the storage media is a multiple of the logical amount intended to be written.

Because flash memory must be erased before it can be rewritten, with much coarser granularity of the erase operation when compared to the write operation, the process to perform these operations results in moving (or rewriting) user data and metadata more than once. Thus, rewriting some data requires an already-used-portion of flash to be read, updated, and written to a new location, together with initially erasing the new location if it was previously used.

Due to the way flash works, much larger portions of flash must be erased and rewritten than actually required by the amount of new data. This multiplying effect increases the number of writes required over the life of the SSD, which shortens the time it can operate reliably. The increased writes also consume bandwidth to the flash memory, which reduces write performance to the SSD. Many factors will affect the WA of an SSD; some can be controlled by the user and some are a direct result of the data written to and usage of the SSD.

Intel and SiliconSystems (acquired by Western Digital in 2009) used the term write amplification in their papers and publications in 2008. WA is typically measured by the ratio of writes committed to the flash memory to the writes coming from the host system. Without compression, WA cannot drop below one.

Using compression, SandForce has claimed to achieve a write amplification of 0.5, with best-case values as low as 0.14 in the SF-2281 controller. \text{write amplification} = \frac{\text{data written to the flash memory}}{\text{data written by the host}} The two quantities used for calculation can be obtained via SMART statistics (ATA F7/F8; ATA F1/F9).

Garbage collection

Data is written to the flash memory in units called pages (made up of multiple cells). However, the memory can only be erased in larger units called blocks (made up of multiple pages). If the data in some of the pages of the block are no longer needed (also called stale pages), only the pages with good data in that block are read and rewritten into another previously erased empty block. Then the free pages left by not moving the stale data are available for new data. This is a process called garbage collection (GC).

All SSDs include some level of garbage collection, but they may differ in when and how fast they perform the process. Garbage collection is a big part of write amplification on the SSD. Reads do not require an erase of the flash memory, so they are not generally associated with write amplification. In the limited chance of a read disturb error, the data in that block is read and rewritten, but this would not have any material impact on the write amplification of the drive.

Background garbage collection

The process of garbage collection involves reading and rewriting data to the flash memory. This means that a new write from the host will first require a read of the whole block, a write of the parts of the block which still include valid data, and then a write of the new data. This can significantly reduce the performance of the system.

Many SSD controllers implement background garbage collection (BGC), sometimes called idle garbage collection or idle-time garbage collection (ITGC), where the controller uses idle time to consolidate blocks of flash memory before the host needs to write new data. This enables the performance of the device to remain high. The background garbage collection also carries some other operations, such as buffer flushing (SLC buffer or DRAM buffer) and flash memory refresh.

If the controller were to background garbage collect all of the spare blocks before it was absolutely necessary, new data written from the host could be written without having to move any data in advance, letting the performance operate at its peak speed. The trade-off is that some of those blocks of data are actually not needed by the host and will eventually be deleted, but the OS did not tell the controller this information (until TRIM was introduced).

The result is that the soon-to-be-deleted data is rewritten to another location in the flash memory, increasing the write amplification. In some of the SSDs from OCZ the background garbage collection clears up only a small number of blocks then stops, thereby limiting the amount of excessive writes. Another solution is to have an efficient garbage collection system which can perform the necessary moves in parallel with the host writes. This solution is more effective in high write environments where the SSD is rarely idle.

The SandForce SSD controllers and the systems from Violin Memory have this capability. \text{over-provisioning} = \frac{\text{physical capacity}-\text{user capacity}}{\text{user capacity}} Over-provisioning typically comes from three sources: The computation of the capacity and use of gigabyte (GB) as the unit instead of gibibyte (GiB). Both HDD and SSD vendors use the term GB to represent a decimal GB or 1,000,000,000 (= 10 9 ) bytes.

Like most other electronic storage, flash memory is assembled in powers of two, so calculating the physical capacity of an SSD would be based on 1,073,741,824 (= 2 30 ) per binary GB or GiB. The difference between these two values is 7.37% (= (2 30  − 10 9 ) / 10 9  × 100%). Therefore, a 128 GB SSD with 0% additional over-provisioning would provide 128,000,000,000 bytes to the user (out of 137,438,953,472 total).

This initial 7.37% is typically not counted in the total over-provisioning number, and the true amount available is usually less as some storage space is needed for the controller to keep track of non-operating system data such as block status flags. The 7.37% figure may extend to 9.95% in the terabyte range, as Manufacturer decision. This is done typically at 0%, 7%, 14% or 28%, based on the difference between the decimal gigabyte of the physical capacity and the decimal gigabyte of the available space to the user.

This type of OP is usually called static OP. As an example, a manufacturer might publish a specification for their SSD at 100, 112, 120 or 128 GB based on 128 GB of possible capacity. This difference is 28%, 14%, 7% and 0% respectively and is the basis for the manufacturer claiming they have e.g. 28% of over-provisioning on their drive. This does not count the additional 7.37% of capacity available from the difference between the decimal and binary gigabyte.

Known free user space on the drive, gaining endurance and performance at the expense of reporting unused portions, or at the expense of current or future capacity. This free space can be identified by the operating system using the TRIM command. This type of OP is usually called dynamic OP. Alternatively, some SSDs provide a utility that permits the end user to select additional over-provisioning.

Furthermore, if any SSD is set up with an overall partitioning layout smaller than 100% of the available space, that unpartitioned space will be automatically used by the SSD as over-provisioning as well. Yet another source of over-provisioning is operating system minimum free space limits; some operating systems maintain a certain minimum free space per drive, particularly on the boot or main drive.

If this additional space can be identified by the SSD, perhaps through continuous usage of the TRIM command, then this acts as semi-permanent over-provisioning. Over-provisioning often takes away from user capacity, either temporarily or permanently, but it gives back reduced write amplification, increased endurance, and increased performance.

Sequential writes

When an SSD is writing large amounts of data sequentially, the write amplification is equal to one meaning there is less write amplification. The reason is as the data is written, the entire (flash) block is filled sequentially with data related to the same file. If the OS determines that file is to be replaced or deleted, the entire block can be marked as invalid, and there is no need to read parts of it to garbage collect and rewrite into another block. It will need only to be erased, which is much easier and faster than the read–erase–modify–write process needed for randomly written data going through garbage collection.

Text derived from https://en.wikipedia.org/w/index.php?oldid=1378885763 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

27 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.