hard disk ssd You don’t know about SSDs those things

hard disk ssd You don’t know about SSDs those things

hard disk ssd You don’t know about SSDs those things

disco solidoSSD OEM Hard disk ssd from 2005 Samsung as the first to enter the SSD giant hard disk ssd, to now just 15 yearshard disk ssd,SSD Has become a very common storage medium, compared to the mechanical hard disk HDD, SSD in the IOPS hundreds of times, bandwidth increased several times, and now NVMe hard disks have further improved the performance of ordinary SATA SSDs nearly ten times. Whether it is an ordinary SATA SSD, or an NVMe SSD, for most people, it is just a change in media and performance, and ordinary people and even IT engineers will simply think that as long as the SSD is used, the performance of the storage system to access data will also be improved by hundreds of times. The question, in fact, is very much like this, as long as the Ferrari engine is installed, the car must be fast? I think only Ferrari engineers know how much wind resistance is added to any change in the body, affecting the speed of a few hundredths of a second.

hard disk ssd
hard disk ssd

this article is described as simply as possible to explain to you the things you want to know but don’t know about SSDs.

SSD particles (Cell), page (Page) and block (Block). There are two important components in the SSD, one is the particle (Cell), the other is the controller, about the controller we will talk about it later, first talk about the storage unit. Today’s mainstream SSDs use NAND particles (of course, newer SSDs use 3D NAND) to store data, and each particle can store 1 bit (SLC), 2 bit (MLC), 3 bit (TLC) or even 4 bit (QLC) data. The more bits are stored in the pellet, the higher the density and the lower the manufacturing cost, but the durability (or life span, erase and write count) of the pellets is lower. The smallest unit read or written to an SSD is not a particle, but a page composed of a set of particles, and the typical Page size is 4KB. An important feature of SSDs is that once particles are written, they cannot be overwritten, unlike magnetic media-based mechanical disks. In order to be able to repeat the write, the SSD needs to erase the particles that have already been written, and the smallest unit of erasure is neither a particle nor a page, but a block consisting of several pages. The typical size of an SSD block is 512KB or 1MB, which is 128 Page or 256 Page. Other behaviors of SSDs and the optimization of storage systems for SSDs are closely related to these basic features.

data manipulation and garbage collection (GC). Data operations include read and write, where the read delay is relatively stable, and the write delay will change somewhat, depending on the use of the disk, under normal circumstances, it is tens of microseconds. Compared to mechanical hard disks, SSDs have one more erase operation, and the erase is in blocks, which has been discussed earlier. Garbage Collection in SSDs is used to reclaim blocks that have been used but whose data is no longer valid. The SSD controller sets a threshold on the number of available blocks, and when the available blocks fall below this threshold, garbage collection is initiated.

Wear Leveling and Write Amplification 。 SSD blocks can perform a limited number of erase operations, also known as programming/erase (P/E) cycles, and when writes are very frequent, erase operations occur more frequently. Once the maximum number of P/E is reached, the block can no longer be written. For SLC, the number of erasables is usually 100,000 times, MLC is usually more than 10,000 times, and for TLC blocks, it is several thousand. To ensure capacity availability and write latency performance, the SSD controller needs to balance the number of erases of individual blocks, which is one of the core jobs of the SSD controller, also known as the “loss balancing” mechanism. During loss equalization, data moves between blocks and then erases. Since what is erased is data that is no longer valid, and what is moved is valid data, the valid data in the SSD is usually larger than the data that is actually written, which is called write amplification WA (Write Amplification).

SSD controller, said so much, you should be able to feel that SSD is definitely not what everyone imagines to find a particle to write down the data, and then take it out when you need to read it. Read and write addressing, the movement of pages inside the SSD, block erasure, write amplification control, and how to balance losses are all done by the SSD controller. In particular, everyone may be confused, the data is moved from the original page to a new place, the old page may be erased, how can the upper-level program find the new address? This is the processing logic of the controller, and a lot of the logic in it is even solidified into the circuit, such as the conversion of physical address to virtual address (the upper-level application is addressed through the virtual address, so the change of the underlying address does not affect the upper-level application at all), it is a circuit-level operation, and the delay is microseconds or even nanoseconds.

for the typical differences between SSDs and HDDs, storage systems should also be targeted for SSD optimization, the effect of these optimizations is reflected in many aspects, including performance improvement, SSD use efficiency improvement, SSD life extension and other aspects. Here are a few common optimizations for SSD storage systems.

take advantage of local SSD performance as much as possible

< p data-pid=”9Q5kngMD” > In the ERA OF HDD, the latency of HDDs is at the millisecond level, which can almost erase the impact of network latency, so as long as the optimization of network protocols and network interactions is guaranteed, applications can access remote HDDs. However, the latency of the SSD has reached the microsecond level, and unless a high-performance network with very low latency is used, the delay in accessing remote SSD data will be significantly affected. For distributed storage, on the one hand, while the data is decentralized, the capabilities of the local SSD must be utilized as much as possible, that is, the trade-offs in the data placement strategy must be made.

In this regard, we combine metadata placement algorithms and strategies to adopt a part of the localized SSD access to the metadata of the YRCloudFile distributed file system. At the same time, intelligent caching technology will be introduced to cache a large amount of hot data in the designated SSD local device to further reduce access latency.

control SSD capacity usage

the use of SSD capacity (i.e., how full the disk is) affects the write amplification factor and the write performance loss caused by GC.

during the GC, the block needs to be erased to create an idle block. Erasing a block requires a page that holds valid data inside the block in order to get an idle block. Creating an idle block may require compressing and moving page within multiple blocks, depending on how “full” the block is.

assuming that the SSD capacity has been used in A%, as a rule of thumb, in order to erase a block, it is necessary to move and compress 1/1-A block. Obviously, the higher the usage of the SSD, the more blocks will need to be moved to free up one block, which will take up more resources and result in longer IO wait times. For example, if A = 50%, only 2 blocks are compressed to free one block. If A = 80%, about 5 blocks of data are moved to free one block. If you consider the page on the block, the data that needs to be manipulated is even more amazing, assuming that each block has P pages, and all pages contain valid data, then each Garbaged Collected needs to copy PA/1-A page. If each block contains 128 pages, each blcok needs to copy 128 pages when A = 50%, 512 pages when A = 80%, and 2432 pages when A = 95%. As shown in the following figure:

control the usage capacity of the SSD, which has practical significance for GC efficiency, disk life, and write latency of upper-layer applications.

use multithreading for small IO access

SSDs have multiple levels of internal parallel processing, including: channel, package, chip, and plan. A single IO thread cannot take full advantage of all of these parallel features, and using only a single thread for small IO accesses results in longer overall access latency. With multiple threads for concurrent access, you can take advantage of these concurrency features inside the SSD. Support for Native Command Queuing on SSDs can efficiently distribute read and write operations across multiple channels, improving internal IO concurrency. Therefore, it is very beneficial for the upper-layer application or storage system to access small IO concurrently as much as possible, which is very beneficial to the improvement of read and write performance. If multithreaded concurrency is difficult for a single application, you can consider multiple applications to access data concurrently to make full use of the concurrency nature of SSDs.

for example, we use an application to perform a 10KB write IO, as shown in the following figure. With an IO thread, it can reach 115MB/s. Two threads basically double the throughput; and 4 threads doubled again. About 500MB/s can be reached using 8 threads.

then the question arises, how small the “small” IO is. It is generally believed that the UPPER LIMIT of IO, which takes full advantage of the internal parallelism of the SSD, is considered a “small” demarcation. For example, if the page size of an SSD is 4KB and the degree of parallelism that SSD can support is 16, the threshold is 64KB.

SSD has been used a lot of storage systems, in general, the storage system using SSD will have better performance than the storage system using HDD, but when not optimized, simply treating SSD as an ordinary storage device can not give full play to the extreme performance of SSD, especially NVMe. This is because the working principle of SSDs is quite different from ordinary HDDs, and the access characteristics are also different. In order to make full use of the performance advantages brought by SSDs, modern storage systems, especially distributed storage systems, need to optimize SSDs in a targeted manner.

through this small article, I hope to let everyone understand the working principle of SSD, as well as the basic optimization methods, we will also share more for SSD programming, improve performance of the means and practices in the future article.

about Yanrong Technology

yanrongyun.comdisco solidoSSD OEMhard disk ssd