Bookmarks

NVMe — NVMe protocol

Non-Volatile Memory Express

A command standard for solid-state drives on the PCIe bus: up to 65,535 command queues instead of the single queue of the AHCI protocol.

Also: nvme ssd, NVMe drive

checked 9 Nov

All terms

NVMe was designed specifically for flash memory: the first version of the specification was published in 2011, and today the standard is maintained by the NVM Express consortium of more than a hundred companies. The protocol’s task is to unlock a drive’s full parallelism, which used to be held back by rules written for hard disk drives.

Queues instead of one

Before NVMe, drives worked through AHCI, a protocol designed for mechanical drives with a single mechanical head. It kept one queue per controller with no more than 32 commands in it, and wasted costly cycles: each access to the controller’s registers cost about two thousand cycles, and a single command required up to nine such accesses.

PropertyAHCINVMe
Designed forhard disk drivesflash memory
ConnectionSATAPCIe
Command queues1up to 65,535
Commands per queueup to 32up to 65,536
Register accesses per commandup to nineup to two

NVMe works differently: CPU cores place commands in ring queues in main memory and notify the controller with a single write to its register. Each core gets its own queue, with no locks and no waiting for one another — so fast drives are not held back by the protocol when delivering hundreds of thousands of IOPS.

What it means in practice

A drive on four PCIe 4.0 lanes reads sequentially at about 7 GB/s, while a random access takes tens of microseconds — several times less than on SATA drives. That is why NVMe drives host databases, caches and training checkpoints, where random-read speed matters. Form factors for every case: PCIe cards and M.2 in laptops, U.2 and EDSFF in servers.

NVMe over Fabrics

The same command set also works over a network: the NVMe over Fabrics specification, published in June 2016, described carrying NVMe commands over RDMA and Fibre Channel, and the TCP transport was added later. This is how networked block storage is built: a server sees another server’s drives as local, and the microseconds of the network are added to the microseconds of the drive.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • PCIePCI Express bus

    PCIe is the bus that carries the data, NVMe is the command protocol on top of it; a drive can be NVMe or SATA.

  • block storage

    Block storage is a drive the server sees as a block device, local or networked; NVMe over Fabrics is a way to attach such a drive over a network.

In depth in the references

where the topic is covered in detail