Use this when tuning NVMe submission/completion queues and interrupt affinity.
NVMe Queues
NVMe queues are paired submission and completion queues, usually one pair per CPU core, so cores issue I/O in parallel without locking. Deep queues are why NVMe sustains high IOPS.
1. NVMe queues map to CPU cores for parallelism.
2. Many queues avoid locking.
3. Queue depth affects throughput and latency.
4. Interrupt coalescing settings.
5. Check with blk-mq sysfs.
CPU core → own queue pair → device
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
ls /sys/block/nvme0n1/mq/
cat /sys/block/nvme0n1/queue/nr_requests
Step 2 Common mistakes Narrow the fault
- Assuming more queues always means more 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.
- One submission/completion pair per core is typical.
- Deep queues enable high IOPS.
- Interrupt affinity matters.
nvme get-feature /dev/nvme0 -f 7 -H— queue countls /sys/block/nvme0n1/mq/— blk-mq hardware queuescat /sys/block/nvme0n1/queue/nr_requests— queue depth
ReferenceHow it works1 section · depth on demand
Why queues matter
Each CPU core can submit I/O to its own queue without locking, so NVMe scales with cores. Applications see the benefit only with enough outstanding I/O (queue depth); single-threaded, QD1 workloads mostly see the lower latency.
ReferenceImportant terms & boundaries2 sections · depth on demand
Key facts
| Item | Value |
|---|---|
| Admin queue | 1 per controller |
| I/O queues | Up to 65,535 |
| Commands per queue | Up to 65,536 |
| Linux default | One queue per CPU core (blk-mq) |
In depth
Each NVMe controller has one admin queue pair and many I/O queue pairs (submission + completion). Linux blk-mq creates one hardware queue per CPU (or per group of CPUs, up to the drive's limit) so cores submit without sharing locks; completion interrupts are steered back to the submitting core.
Queue count rarely needs tuning. What matters is the application's outstanding I/O: a single-threaded synchronous workload issues one I/O at a time and sees only the device latency, whereas a database with many threads, or fio --iodepth=32 --numjobs=4, uses the parallelism. Use iostat -x (aqu-sz) to see how much is actually queued.
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 Queues. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://nvmexpress.org/specifications/ · confidence 94%