📜 ⬆️ ⬇️

The whole truth about the SSD backup area, and whether it is needed at all

Hi, Giktayms! Many SSD manufacturers advise leaving unallocated space or specific free space on solid-state drives for improved performance. We will try to figure out whether a backup SSD area is needed at all, and how it affects the performance of the drives. By tradition, all the details under the cut.



Little about the main thing


Last time, we told you about how flash memory works. The principle of its work visually perfectly characterizes the picture below. Block (X) could be cleared for later recording due to the presence of a free block (Y) - new pages were written into block (X), and then into (Y), after which the block (X) was erased.


')
This is just one example of how flash works. The bottom line is that when there is a lot of free space on the SSD, then there are a lot of such units as (Y). Although the speed of the controller itself is constant, the performance of the drive itself may vary. The fewer free blocks of flash memory, the more processes it has to perform before data is written, and hence the speed of the drive will suffer. For example, when filling an SSD by 98%, there are less and less free blocks. Question one: what happens if during such a busy drive you start recording large amounts of data? This is where the backup SSD area comes in handy.

What is a backup area and why is it needed?


In fact, the operating system does not recognize the entire amount of memory in solid-state drives. The reserve area of ​​the SSD or the so-called spare area is allocated on the principle of over-provisioning and is visible only to the controller. To understand how it works, it is useful to consider, and how, in fact, measured the capacity of SSD.

SSD capacity is measured in gigabytes (decimal prefixes) and gibbytes (binary prefixes). If in one gigabyte 1 billion bytes, then in gibibite ~ 1,074 x 10 in the ninth power byte. Manufacturers, including OCZ, indicate the capacity in gigabytes, while the operating system performs its calculation in gibbytes. Because of this, it turns out that the actual capacity of the drive is less than stated.

For example, interesting statistics on one of the drives. He has 264 GiB NAND on board, but only 186 GiB are available to the user, compared with 200 GB stated by the manufacturer. The rest of the SSD is used as a backup area to improve drive performance and endurance.


As a rule, the backup area is about 7% of the total NAND capacity. To calculate the actual SSD capacity in GiB, you need to divide the capacity in gigabytes by 1,073741824. In the case of a 256 GB drive, this will be 238.4 GiB. The rest of the SSD and is used as a spare area. For clarity, let us once again turn to how flash memory works.

People often ask why some SSDs have a capacity of 120/240/480 GB, when others are 128/256/512 GB. In the case of OCZ, the physical volume of these pairs of storage tanks is the same. The difference lies in the amount of reserve for different models: with full volumes of 128/256 / 512GB, there is no reserve, and on 120/240 / 480GB there is a reserve area that is not available to the user.


The relationship between write amplification and spare area is well reflected in the IBM research lab report:

As you can see, the larger the backup area, the smaller the recording gain. Due to the presence of such a relationship between them, manufacturers and recommend not to load the solid-state drive completely, and leave from 10% to 20% of free space. What for SSD generally need a backup area?


Firstly, the so-called garbage collection (garbage collection), which we disassembled in the first picture, is performed less often due to the fact that the operating system cannot access the backup area and fill up free memory blocks - therefore, the controller gets access to more memory blocks. Therefore, SSD always has free blocks “in reserve”, which is important. In addition, if one of the memory blocks fails, the controller takes free from the backup area. Also, the spare area affects the leveling of depreciation: if the data is written to the same block, the drive resource will be depleted by increasing the number of blocks rewriting cycles. The controller distributes the data evenly, thereby equalizing the wear.

And what about performance?


For companies, it is very important to have drives with a large amount of backup area, since it is there that attacks with random data most often occur. The more blocks of the backup area available to the controller, the greater the likelihood that the controller will work correctly, and the performance of the SSD will not fall even under heavy load. OCZ has excellent corporate solutions for these cases - Z-Drive 6000 NVMe, Toshiba Hawk 4R (THNSN8) and Hawk 4E (THNSN8). 2900 MB / s for reading and 1900 MB / s for writing, capacity up to 6.4 TB.



But let's not be unfounded, we better show how the performance of the SSD depends on the volume of the backup area with the help of tests. To do this, we take one of the drives with a controller that is not optimized for an increased backup area and will gradually increase the size of the spare area - from 12% up to 50%. The last option at home, of course, excluded, but it is important to capture the essence.

We will compare in terms of IOPS - the number of input and output operations - in simple terms, the number of blocks that is read or written to the media. Accordingly, the higher the value, the better. Determined by IOPS as a quotient of speed and block size when performing an operation. First, take an SSD with a standard reserve area (about 7%). Here are some indicators he boasts in the tests:


And now we will have a little experience - we will increase the reserve area to 12% and again measure IOPS.


The difference, albeit small, is still visible - IOPS has clearly increased. Well, let's not stop there, increase the backup area to 25% - a quarter of the drive is now available only to the controller.


We think everything is clear without words. However, it is obviously inexpedient to give as much of the backup area as only 3/4 SSDs become useful. And hardly anyone will repeat this at home, but for the purity of the experiment, we still do it. Yes, we will increase the spare area to 50%.


Changes in performance are noticeable, but certainly not enough to give half the drive under the reserve. This is simply impractical because the performance increase in this case will not be able to compensate for the lost SSD capacity. One thing is clear for sure: the size of the backup area does affect the speed of the drive. If you decide to repeat such a test with your SSD, keep in mind that the results may differ depending on the controller, firmware and, in fact, the manufacturer and model of the drive itself.

In addition to performance, the backup area also reduces wear on solid-state drives and extends their lifespan. There is no need to carry out any tests: obviously, if fewer read / write operations are performed, the amount of recorded data also decreases. So the more spare area, the longer the drive will serve you (but, as we said, you should not abuse it).

How to change the size of the backup SSD area?


Typically, manufacturers give this opportunity in their proprietary utilities for solid-state drives. At OCZ, this is implemented very simply and conveniently using the special SSD utility Guru - it not only monitors the state of the SSD, but also monitors SMART, includes the TRIM command, automatically checks for new firmware - in general, an indispensable assistant for users of our drives. We have already introduced you to the utility itself, so pay attention only to the tab that is needed in our case.

Go to the Tuner tab and get access not only to Trim activation, but also to over over setting on the fly: just drag the slider and choose the size of the backup area yourself. In our case, for example, it is possible to increase the spare area to 134 GB - despite the fact that the volume of the drive itself is 480 GB. It turns out almost 28%.

If you want to do it yourself, just hide part of the drive from the operating system - leave unallocated space on it.


Take care of your drives!


Of course, even without manipulating the backup area, the solid-state drive will serve you for a long time: the good of most of the myths about the fragility of SSDs have been dispelled. If possible, drive, of course, should be protected, but only if it does not limit your needs. The easiest way is to leave free from 10 to 20% of the amount of SSD available to you: for you, not for the controller.

Source: https://habr.com/ru/post/393131/


All Articles