As a general consumer, you will see a variety of M.2 interface SSDs through online or offline stores often overwhelmed and do not know what to choose. Especially since some SSDs are written to support the SATA protocol and some to support NvME, which is a good choice in the end?
NVMe, as a newer technology, is certainly faster and has less latency than SATA SSDs. Especially now SATA interface undoubtedly constitutes the SSD speed bottleneck.
Today, let’s take a technical look at why NVMe is faster than SATA, and how much faster. And to the general consumer how to choose to do directional guidance.
- SATA M.2 SSDs are connected to SATA ports on the Southbridge, on which the traditional AHCI stack (a subset of SCSI) runs, with long and high latency. AHCI has only 1 command queue with a queue depth of 32, and congestion can occur if a large number of small file operations occur.
- If NVMe SSDs are used and PCIe channels are used, the protocol stack is very shallow. NVMe can have up to 65535 queues, and each queue can have up to 65536 commands. NVMe also takes full advantage of MSI’s 2048 interrupt vectors, reducing latency significantly, especially for large numbers of small files.
- AHCI is also based on traditional block transfers. NVMe, on the other hand, uses a mechanism called Doorbell to take advantage of extremely long queues and greatly reduce latency.
Let’s take a look at the numbers. To see how NVMe reduces the time consumption of the protocol stack itself, we used blktrace to analyze the time consumption and proportion of a set of transport at the application layer, operating system layer, driver layer, and hardware layer to understand the performance differences between AHCI and NVMe protocols:
As a reference, HDD latency is very large, reaching 14ms, compared to 125us for AHCI and 111us for NVMe. As shown in the figure, the time occupied by NVMe, protocol stack, and below is significantly reduced compared with AHCI, and the waiting time at the application level is very high. This is because the SSD physical disk speed is not fast enough, resulting in application idling. NVMe also leaves plenty of room for speed improvements with low-latency media like Optane hard drives in the future.
How is it used in practice? MySQL database:
- a) is a SATA SSD with a weedy green surface that spends a lot of time waiting.
- b) Four SATA SSDS form a RAID, reducing the waiting time.
- c) is an NVMe hard disk, hardly see the green, almost no longer wait.
- d) Is RAM disk, the green is completely gone, and the user mode ratio is very high.
From the above analysis, we can see that NVMe has been greatly optimized in software and hardware compared with SATA protocol, which greatly reduces the overhead of the protocol stack and improves responsiveness.
The performance-sensitive server market has seen increasing use of NVMe
What about the average consumer? Of course, try to choose NVMe, especially SATA M.2 price is not cheap, there is only to apply to the old motherboard.
Some motherboards have special processing. Depending on the M.2 hard disk, the BIOS can use SATA channels of the PCH or PCIe channels to support NVMe. In this case, NVMe SSDs must be purchased. So do BIOS need to modify a lot, some motherboard manufacturers or motherboard manufacturers are BIOS contractors in order to be simple and some safety considerations, factory limited to support which, then need to read the motherboard instructions, don’t buy the wrong, can only return. Of course, the old motherboard only supports the SATA interface, there is no choice.