We raise the performance of SSD from the knees, where to click and why

    In fact, today we are not talking only about used drives for some time, because the problem of low speed can affect even the SSD just brought from the store. Of course, you can’t deceive physics - over time, all SSDs will lose performance. But the reason for this can be not only the problem of the SSD itself. Ensuring competent interaction of components and software in the system is not an easy task for ordinary users who do not want (or who simply do not need) to understand the topic in the slightest degree and listen to the advice of competent people in this regard. It is easier for someone to reinstall the operating system or add some dubious “tweakers” to the list of applications used. But think about it - for example, a simple file removal from our point of view consists of a sufficiently large number of stages in which several participants are tied at once. And, if at least one of them worked the task incorrectly, then this affects the performance of the disk. What are these stages? By whom or how are they carried out? How to ensure stable operation? We’ll understand all this today. Simple and clear, so that everyone understands. And then it becomes clear that treating the symptoms of poor SSD performance will not help.


    Seven Troubles - One Deallocate


    Many have heard about the TRIM command. Those same treasured four letters that cause a lot of questions for the average user. TRIM is one of the ATA commands sent by the operating system to notify the solid-state drive that the data has been deleted from the disk by the user and that the occupied physical cells can be freed. It is worth mentioning separately about SSDs with the NVMe interface - these disks have a different set of commands for working, but the ATA analogue of the TRIM command also exists there - it is called Deallocate and, accordingly, is identical. Therefore, further when mentioning TRIM, we will also mean Deallocate too. Why talking about all this? It is precisely the problems with the execution of these commands in the vast majority of cases that are the reason for the low performance of the drives. Of course, we will not leave other problems aside,



    At the moment when you delete data from your drive, in fact, the entry in the main table of the file system is deleted. That is, the data itself remains in place, but the area is marked for deletion. The “cell cleaning” itself takes place at a certain time, for example, when the drive is idle, while you are away for tea. Thus, manufacturers achieve reduced memory wear and increase the performance of their drives in certain scenarios. It is the cleaning of these cells that the controller is engaged in by executing the TRIM command. By the way, after its implementation, data recovery is almost impossible.

    More recently, we talked about Secure Erase technology., which is similar to TRIM, but affects not only the main cells, but also service areas, returning the drive to its original state. Recall that Secure Erase can only be performed on a drive without a file system and under certain conditions. And TRIM technology just requires an operating system with all the attendant requirements.


    Let’s explain on the fingers, just 20 of them ...


    When you create a file, the operating system sends a write command to the address of a specific logical unit. When you delete data from the disk, these blocks are marked as free.
    In this case, the data will remain on the disk until the controller wants to overwrite it.

    Before us is the part of the memory in which the files A and B are of different sizes, occupying, respectively, a different number of blocks. First, we delete file B, and then write file C to our disk. To illustrate the situation when TRIM is not working, we add a simple illustration in which the following states are indicated:

    1. The presence of files A and B.
    2. Delete file B.
    3. A certain time of inactivity. Note that the data blocks marked for cleaning remain with the data in them.
    4. Write file C, but first, delete file B from the cells.

    For example, if you imagine (just imagine, yes) that the data block in the form of a square is 1 MB, then in step 4 the controller first clears the two data blocks marked for deletion with file B and only then writes file C. If a couple of megabytes of space - even little things, but with active work with the drive of such blocks, the total may be gigabytes, which will already noticeably affect the time of writing operations.



    And now what happens if TRIM works. Again in stages:

    1. The presence of files A and B.
    2. Delete file B.
    3. The specific idle time at which blocks marked with deletion with file B are cleared.
    4. Write file C without any delay to the area where file B was.



    That is, the logic of the work is completely different. Let’s repeat what has been done - at the moment we delete file B, the TRIM command is sent, and since it is idle quite often in the SSD, it happily deletes unnecessary blocks almost immediately. And at the moment we want to write file C, it is immediately written to disk, and does not wait until the blocks with garbage are cleaned for it.

    TRIM, but are you at all? And if so, do you work?


    You can find out if the SSD supports the TRIM command using a fairly large amount of free software. Take CrystalDiskInfo, for example:



    But demonstrating support is not work. To get started, let's go through situations where TRIM needs to be run in a tricky way or this command does not work at all. Of course, the situation may change over time, but so far things are as follows:

    1. Standard Windows drivers cannot perform TRIM on RAID arrays. Depending on the system and the type of RAID array, a driver from Intel called Rapid Storage may solve the problem. Arrays 0 and 1 are supported with the Enterprise version driver.
    2. TRIM support in Windows starts with the version of the operating system with the number 7. Vista and, moreover, XP do not support TRIM at the OS level. Of course, this problem is solved by third-party software, but here everything is at your own peril and risk - we cannot and will not recommend it.
    3. The Deallocate command (TRIM for NVMe SSD) is only supported with Windows 8 and later.
    4. TRIM does not work on virtual disks.
    5. TRIM only works in AHCI mode.
    6. TRIM does not work when connecting a drive via USB adapters.
    7. TRIM does not work with the FAT32 file system (and more “shaggy”).

    Now let's check - does TRIM work in the system?

    For starters, let's try to find out right from the operating system. In the command line or PowerShell launched on behalf of the Administrator, enter the command “fsutil behavior query disabledeletenotify” without quotes and look at the result. If "0" appears in the output, then this is good - TRIM works. If "1", then the TRIM functionality is not available. That's right: zero - an enabled command, 1 - a disabled command.



    For example, you can use the easy-to-use trimcheck program from Vladimir Panteleev. The program works in two stages, between which several seconds or tens of minutes can pass - it all depends on the specifics of a particular SSD model. The utility writes data to disk and marks the addresses of the virtual blocks in which they are located. She saves these addresses to a JSON file in her folder, and then deletes the data, which causes the sending of the TRIM command. The utility looks to see if the previously recorded data is stored in the stored addresses. Their absence means that the controller took note of the TRIM commands and deleted the data. If TRIM works, then the message will be appropriate:



    Otherwise, the inscription will read TRIM appears to be NOT WORKING. Actually, if you receive a message about inoperability, then run the command “fsutil behavior set disabledeletenotify 0” without quotes in the command prompt launched on behalf of the Administrator or PowerShell. The TRIM function, if all conditions are met (supported OS, implementation in SSD, etc.), should turn on and work. If this does not happen, and all the requirements are met, then you will have to think about replacing the drive.

    Problems, problems instead of lunch

    The most common problem is inheritance. Of course, we are talking about Windows up to version 8. For example, when a user installs SSDs in old systems or switches from HDD to SSD without changing BIOS settings (if necessary) or even by cloning partitions or the entire disk. We remind you that TRIM is only available in AHCI mode. For example, many motherboards can work in two modes AHCI and IDE. Accordingly, if an SSD is connected to such a card in the IDE mode, then TRIM will not work. Just having AHCI mode does not solve the problem - Windows will install drivers according to the selected IDE. It would seem that the situation may be rare, but in reality - no. If you are not friends with the BIOS settings, then at least you need to check the operation mode. You can do this in the device manager in the "IDE ATA / ATAPI Controllers" section:



    Remember that just after installing Windows, switching from IDE to AHCI (and vice versa) will not work without additional manipulations - the operating system simply will not boot. There are solutions to this problem (even from Microsoft itself), but they are not worth recommending. It requires changing the registry settings, adding the right driver and readiness to reinstall the OS in case of failure.

    As for Linux-systems, the prerequisite, in addition to the hardware component, is the ext4 file system. The inclusion of TRIM is indicated by the discard option in the fstab file. Additional useful options for the section will be noatime (realtime or nodiratime), which will reduce the record by disabling updating the time of the last access to files and directories. The TRIM command itself is launched using the fstrim program - “fstrim / -v” without quotes and with root privileges.

    Recall also about Secure Erase. You can restore performance with this feature. Only here it is unlikely for a long time. Especially if you quickly clog your drive with new data. So as a temporary solution, it will, but it will always remain temporary.

    We’ll also add about SLC caching, which is often used by many SSD drives without being tied to an interface. The low write speed of a large number of files (or large files) after a certain threshold is not a problem, but a feature of work. The essence of caching is that first the data being written falls into a special area of ​​memory, and only then it is written to the main memory in the background. When the allocated high-speed memory ends, the data begins to be written directly to the memory at a noticeably reduced speed - from 50 to 150 MB / s. This is a completely normal mode of operation of drives with an SLC cache, so here nothing can be done from the word at all.



    What is good and what is bad?


    If the TRIM function worked from the very beginning, then by itself it cannot go anywhere. But it’s a completely different matter if you are fond of all sorts of tweakers, third-party drivers or firmware, as well as builds of operating systems that are supposedly improved. All these programs and assemblies can only do much harm when it comes to Windows 8, and even more so Windows 10 - everything is thought out as it should in these OSs. In the "seven" they can help with something, but this is rather an exception to the many problems that they can bring.

    Separately, I must say a few words about NVMe drives and drivers for them. When purchasing a high-speed SSD, the declared speed indicators obtained in the benchmarks should be reflected in your eyes. This is often the case, for example, with Kingston drives. Set and forget, as they say, enjoying its high speeds. But with SSDs from other manufacturers, this may not always be the case, which will obviously upset anyone. Here, not the absence of Deallocate is the reason for the lack of performance, but the standard NVMe driver. Yes, yes, when buying some NVMe SSDs from some manufacturers, you have to go to the website of its website and download the corresponding driver - the difference with the standard one can be double!

    Now, like, that's all.


    As it turned out - not everything is as scary as it looked not the first glance. The user is required to follow just a few recommendations in order for the system to work correctly and to please the performance of the solid-state drive for a long time. Let us repeat them at the end - a clean distribution system of the operating system, up-to-date drivers and firmware from the manufacturer, as well as the absence of third-party "tuners" of the system, which, according to their developers, increase productivity by 146%. If the problem is not hardware, then you will not have any complaints about the disk during the entire life of your system. So there will be no long conclusion-verbiage - all that had to be said has already been said. High-capacity SSDs for you, their high speeds and stable performance!



    For more product informationHyperX and Kingston refer to the websites of companies.

    Also popular now: