Reading a report
At the end of ntprof record, and with ntprof report, each group of commands gets a summary. For 4 KiB random
reads over NVMe/RDMA at queue depth 1, both sides recorded and joined:
== read 4KiB nvme6n1: 3066 commands sampled (from about 13.3k commands/s), all with the target's side
latency (us): mean 72.77, p50 69.54, p99 80.30, p99.9 81.83
stage mean us share avg QD
host block layer 0.49 1% 0.01
host driver (nvme-rdma) 1.26 2% 0.02
network (RDMA, NICs, wire) 10.03 14% 0.13 ###
target driver (nvmet-rdma) 1.02 1% 0.01
storage (target block layer, drive) 59.97 82% 0.80 ####################
largest: storage (target block layer, drive), 82 % of the latency
- The header names the group (I/O type, size, namespace), how many commands were sampled, the command rate estimated from them, and whether every sampled command was joined with its target side.
latencyis the end-to-end latency of the sampled commands, from the block request's start to its completion.stage: the five stages in path order. The driver rows name the module, and the network row the transport.mean usandshare: each stage's mean time and its share of the mean latency. The stages add up to the end to end.avg QD: the mean number of commands in the stage, by Little's law (command rate × mean time). Summed over the stages, it is the number of commands in flight in the kernel.largest: the stage with the largest share.
Without the target's records (the host's file alone), the host's receive path is a row of its own, and the network and the whole target are one row, "network and target (not recorded)".
Groups
A group is every sampled command with the same I/O type, size and namespace: read 4KiB nvme6n1 is one group,
write 128KiB nvme6n1 another. Each group gets its own summary, and the line printed while recording has one row
per group. A run that wrote 16 KiB and 128 KiB blocks to the same drive reported two:
== write 16KiB nvme0n1: 2459 commands sampled (from about 311 commands/s), all with the target's side
…
== write 128KiB nvme0n1: 1955 commands sampled (from about 247 commands/s), all with the target's side
…
- Sizes are exact: 4 KiB and 8 KiB are two groups; there are no size ranges.
- Small groups are folded: groups with under 1 % of the records are summed up in one line,
+ N more groups with M records in all (under 1 % each): …, with the first few named. The largest group is always shown.--all-groupsprints every group in full. - Grouping can be coarser. A task file can leave the size, the I/O type or the namespace out
of the grouping. Groups are formed when the report is made, so this also works on recordings already saved; with
sizes left out, our 4 KiB reads became one group
read spdk-c1n1:
[Report]
ENABLE_GROUP_BY_SIZE=false
ntprof report -c merge-sizes.ini host.ntp target.ntp
Filter a saved recording
--io-type, --size and --session choose commands in ntprof report, compare and dump too, from the records
already saved. A host record passes by its I/O type, size and namespace, and its target record goes with it. Our
128 KiB write run had also caught three 4 KiB reads that were not the workload's:
ntprof report --io-type write host.ntp target.ntp
recorded on madracks-gnode4 (kernel 5.15.143), one command in 100 sampled
filters: write (1139 of 1142 host records pass)
== write 128KiB nvme6n1: 1139 commands sampled (from about 5.0k commands/s), all with the target's side
…
- A namespace, not a path:
--session nvme1n1takes every pathnvme1cXn1; a path name is refused. - Nothing left is an error, for example
--io-type writeon a recording of reads. dumpdoes not join: it filters target rows by type and size, and refuses--sessionfor a target's file.
Statistics
--aggregation chooses the statistics of the latency line and of the --detail table, for record, report and
compare:
| Value | Shows |
|---|---|
avg (default) | the mean, p50, p99 and p99.9 |
min | the same and the minimum |
max | the same and the maximum |
dist | the mean, every quantile (p10, p50, p70, p80, p90, p95, p99, p99.9) and the maximum |
latency (us): mean 82.34, p10 78.10, p50 79.33, p70 88.20, p80 88.67, p90 89.25, p95 90.07, p99 91.25, p99.9 92.29, max 93.01
That is --aggregation dist on the tutorial's SPDK NVMe/TCP recording. The stage table
always shows each stage's mean; its quantiles are in --detail and in the JSON.
Components
--detail adds a table that splits each stage into its components, in path order, with the number of commands,
the mean, the occupancy (L) and p50 / p99. This is a 128 KiB random write over NVMe/RDMA at queue depth 1:
components, in path order (L: commands in each, by Little's law)
component n mean L p50 p99 (us)
host block layer, submission 2213 0.20 0.00 0.20 0.26
host driver, submission 2213 2.05 0.02 2.04 2.33
network: wire and NICs (computed) 2213 25.31 0.24 25.28 26.15
data transfer (RDMA, at the target) 2213 15.78 0.15 15.77 16.13
network: target receive path 2213 0.28 0.00 0.26 0.53
target driver, submission 2213 8.55 0.08 8.56 8.88
storage: target block layer and drive 2213 39.01 0.38 38.72 41.92
target block layer, submission 2213 2.02 0.02 2.02 2.16
drive 2213 36.87 0.36 36.57 39.79
target block layer, completion 2213 0.12 0.00 0.12 0.13
target driver, completion 2213 0.45 0.00 0.43 0.59
network: host receive path 2213 0.23 0.00 0.22 0.30
host driver, completion 2213 0.00 0.00 0.00 0.00
host block layer, completion 2213 0.70 0.01 0.71 0.90
handoff to nvme_complete_rq 2213 0.65 0.01 0.66 0.85
end to end 2213 76.78 0.74 76.52 79.90
Each component's name starts with its stage; "submission" is the way down, "completion" the way back up. An
indented row is a part of the row above it: the drive and the target's block layer within storage, the time from
the parsed completion to nvme_complete_rq within the host block layer's completion, and over NVMe/RDMA, the data
transfer within the network. Of this write's 76.8 µs, the drive took 36.9 µs and fetching the data over the
network (its RDMA READ) 15.8 µs.
Cases that need a second look
- A large TCP read's data arrives while the host processes it. The host copies each packet of a read's data
while later packets are still on their way.
--detailsplits that time into "host driver, processing the data" and "network: rest of the data arriving". A 128 KiB read over NVMe/TCP at queue depth 1 arrived in about three packets over 30 µs: the host spent 19.7 µs processing them and waited 24.2 µs for the rest of the data. The wire needs under 3 µs for 128 KiB at 400 Gb/s, so most of that wait is in the NICs and the network stacks. Files recorded before this split show the whole time as "host driver, completion". - A large TCP write's data arrives while the target processes it. A write too large for the command capsule
is solicited by R2T, and the target copies each packet of its data while later packets are still on their way.
--detailsplits that time into "target driver, processing the data" and "network: rest of the data arriving". A 128 KiB write at queue depth 1 took the target 16.7 µs of copying and 23.1 µs of waiting for the rest of the data. Files recorded before this split show the whole time in "target driver, submission". - Large TCP transfers vary between connections. Their network and driver times depend on the CPUs the
connection lands on, by up to about 20 % end to end from one
nvme connectto the next. For a 128 KiB write the difference is in the wait for the data, which also changes from run to run; the target's copying stays near 17 µs. - The network is partly computed. "network: wire and NICs (computed)" is the host's wait minus the target's residence: the wire, the NICs and the network-stack work that neither driver sees. The two receive paths are measured. Over loopback the computed part is close to 0 and can be slightly negative.
- Under load, the RDMA data transfer includes waiting. A read's transfer runs from posting the RDMA WRITE to the target handling its send completion, so a target that polls its completions late adds to it.
- At high queue depth, ntprof's end to end is below fio's latency. Commands that completed in the kernel wait
in the application's completion queue (io_uring) until the application reaps them; ntprof does not count that.
The
avg QDcolumn shows it: for 4 KiB random reads over NVMe/TCP from one fio job at queue depth 32, ntprof counted 27.5 commands in the kernel. - Compare storage times only at the same drive state. A drive that has taken random writes can read 128 KiB more slowly than right after a sequential fill; measure the drive alone at the same time when you compare.
JSON and CSV
-j FILE writes the same report as JSON. The top level holds "tool": "ntprof", the name and kernel of the
machine that recorded (keys host and kernel; for ntprof report, the host's), the sampling period
(sample_every), the throughput (from ntprof record only), and groups. Each group holds its type, bytes
and session, its record counts (records, joined, ...), its command rate (rate_per_s), and:
components, keyed by component, each with itsstage, itsdescription(the name--detailprints), itsoccupancy, and asummaryin nanoseconds (n,mean_ns,min_ns,max_ns, and the quantiles fromp10_nstop99.9_ns);stages, the same summary for each stage, keyedhost_block_layer,host_driver,network,target_driverandstorage.
A component's stage is one of these five keys, or end_to_end for the end-to-end latency, or
network_and_target for the host-only row. ntprof dump FILE... prints the raw records as CSV, one row per
command and side, with every timestamp.
What reports cannot do yet
- Group sizes into ranges. Every size is its own group, so a workload of many sizes gives many small groups.
- Break down only the slowest commands, for example those above the p99 latency.
- Report a saved recording interval by interval. The lines every
-iseconds exist only while recording.