Use this to understand NVMe's command and queue model.
NVMe Protocol
The NVMe protocol is a lean command set for non-volatile memory over PCIe or fabrics. It uses up to 64K queues with 64K commands each and few register accesses, so it scales with CPU cores and flash speed.
1. NVMe uses submission/completion queue pairs with doorbells.
2. Up to 64K queues × 64K entries.
3. Scheduler none is usually best.
4. Admin vs I/O commands.
5. Features via get/set-feature.
application → blk-mq → NVMe SQ → controller → CQ
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
nvme listshows the controller and namespaces.nvme id-ctrl /dev/nvme0for model, firmware and features.- Benchmark with
fio --iodepth=32 --numjobs=4to see parallel performance.
Step 2 Common mistakes Narrow the fault
- Expecting NVMe speed through a SATA/AHCI driver or adapter.
- Ignoring queue depth — single-threaded tests understate NVMe performance.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Up to 64K queues with 64K commands each.
- Few register accesses per command.
- Scales with CPU cores.
nvme id-ctrl /dev/nvme0— controller capabilitiesnvme get-feature /dev/nvme0 -f 7— number of queuescat /sys/block/nvme0n1/queue/scheduler— I/O scheduler (none)
ReferenceHow it works1 section · depth on demand
How it works
NVMe is a command set designed for flash over PCIe. The host and controller communicate through submission and completion queue pairs in memory; the host writes commands, rings a doorbell register, and the controller posts completions. Many queues (often one per CPU core) avoid locking and give low latency.
ReferenceImportant terms & boundaries1 section · depth on demand
Key facts
| Item | Value |
|---|---|
| Queues | Up to 65,535 I/O queues, each up to 65,536 commands |
| Transport | PCIe, or fabrics (NVMe/TCP, RDMA, FC) |
| Namespaces | Logical volumes on a controller (/dev/nvme0n1) |
| Commands | Read, Write, Flush, Dataset Management (TRIM) |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Physical Storage Media → NVMe → NVMe Protocol. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://nvmexpress.org/specifications/ · confidence 94%