netscrew.dev/playbooks/bench
Diagnostics

n bench — how fast is a share, and why

What the six phases measure, why most share benchmarks lie, and how to read the verdict.

Read it offline, in your terminal:n -h bench

n bench //host/share measures what you actually experience when you use a network share, then

explains it: which link you're on, what the two ends agreed to, where the time goes, and what

is — and isn't — the bottleneck. The numbers are the evidence. The verdict is the product.

n bench //host/share          all six phases (~20 s, ≤96 MB of test data, asks first)
n bench <host>                phases 1–2 only: path + protocol. Any SMB server, no mount, writes nothing
n bench .                     this machine's own disk and pressure: the baseline every share is compared against
n bench //host/share --full   256 MB × 5 rounds when you need a confident answer
--yes    skip the "someone's disk" confirmation      --at <dir>   write via a specific mount point

Why most share benchmarks lie

The six phases

1 · PATH — how am I reaching it?

Written before anything else because it explains most results on its own.

| Line | What it tells you |

|---|---|

| Target | Which address was measured and why. A LAN address is preferred over a Tailscale/VPN one, and it says so when your resolver only knew the slower route. |

| Interface | The local interface the kernel routes through; wired or wireless; negotiated speed, duplex, MTU. A gigabit NIC negotiated at 100 Mb/s is almost always a cable (gigabit needs all 8 wires) or a dead switch port. A 2.5 GbE NIC at 1 Gb/s means the switch or cable is the limit. |

| Wi-Fi | Band, channel, bitrate, signal. 2.4 GHz is slow and crowded; the bitrate sets a hard ceiling. |

| Ceiling | The best this link could ever deliver in MB/s, and the assumption behind it (wired ≈ 90 % of line rate; Wi-Fi ≈ 45 % of bitrate because it's half-duplex and shared). |

| RTT | 20 TCP connects to the SMB port — the round trip SMB pays on every request. Over ~20 ms is WAN/VPN territory and small-file work suffers most. |

| MTU test | A don't-fragment ping. If 1500-byte frames don't fit, a tunnel is shrinking the path and every big packet is split and reassembled. |

| Hops | From the reply's TTL; also reveals the remote OS (Windows starts at 128, Linux/macOS at 64). |

| NIC health | Drops and errors on the interface since boot. Errors mean corrupted frames: cable, port or card. |

| Tailscale | Direct peer-to-peer, or relayed through a DERP server on the internet. Relayed is the difference between LAN speed and a few MB/s. |

2 · PROTOCOL — what did the two ends agree on?

n bench speaks a raw SMB2 NEGOTIATE to port 445 — the first packet every client sends — so it

needs no mount, no password and no admin rights, and works against any SMB server (Windows, Samba,

a NAS).

3 · OPS — small files

64 × 4 KB: create → write → close → read → delete, one at a time. This is what copying a source

tree or a photo folder feels like. Reported as files/s and per-file median/worst, against what the

round trips alone would explain (~5 × RTT). A big gap means the server is doing work per file:

Defender scanning every file on close (Windows), or strict sync / VFS modules / a high log level

(Samba), or a slow metadata disk.

4 · THROUGHPUT — big streaming transfer

Rounds of fixed-time writes (random data, made unique per chunk so nothing compresses or dedups it,

fsync inside the timing) and cache-bypassed reads of the previous round's file. First round is

warm-up and excluded. Shown as MB/s, as a percentage of the ceiling with a bar, with the spread.

5 · BASELINE — this machine

The same ops and throughput tests on your own disk (the home directory — /tmp may be RAM), plus

this machine's pressure: cores against load (or CPU %), and how full the disk is. Without this,

"the share is slow" and "my disk is slow" are indistinguishable. n bench . runs this alone; run it

on the *server* when the verdict points there.

6 · VERDICT

The result's shape against the ceiling decides the story:

Each suspect comes with the exact command to check or fix it, labelled as inference ("in order of

likelihood"), followed by what the evidence *cleared*, the noise paragraph, and the cleanup line.

Using it on a home network

A real example: a share served at 12 MB/s and 26 ms per file over a clean gigabit LAN. Phases 1–2

cleared the wire, MTU, signing and VPN; Phase 3 showed per-file time far beyond the round trips;

the verdict pointed at the server. n bench . on the server: *2 cores · load 13.9 · oversubscribed

×7 · disk 97 % full.* The SMB daemon wasn't busy — it was starved, waiting in the run queue behind a

browser and a torrent client. No network tool would have found that; a benchmark that only prints

MB/s wouldn't have either.

Honest limits

Roadmap