testsuite: Add a new shaped-network performance harness#3203
Conversation
🤖 Augment PR SummarySummary: Adds a Docker-based performance test harness that runs the AFP testsuite over a Linux tc-netem shaped veth link, and aligns testsuite output/flags so CI-style perfgraphs can be reproduced locally. Changes:
Technical Notes: The harness disables segmentation offloads so veth counters reflect on-wire sized packets, and captures MSS via 🤖 Was this summary useful? React with 👍 or 👎 |
db9f986 to
58a314e
Compare
|
augment review |
ccc80f6 to
354b331
Compare
|
@rdmark Ready for review and merge. This tool is proving very useful/fun - it is fascinating to see what happens when you reduce and increase quantum and RTT. It shows well how AFP performance reacts as a request/response protocol - and I proves how powerful compound commands are going to be 🙂 The most significant impact by far is changing the RTT (so removing round trips will be 🚀) Try running Running with Quantum 2MB (whilst the performance regression exists) shows how it improves performance for 1MB, but the moment you cross the runt boundary it collapses back down - showing the impact concretely.. Reducing the Quantum benefits small files slightly at the expense of maximum speed for large files - but this is easier to see after the #3196 fix is in place. |
f14006e to
cc86862
Compare
Add distrib/docker/perftest/: a privileged-container harness that runs afpd in the container's root network namespace and drives the CI perfgraph speedtest (or lantest) from a client namespace across a tc-netem shaped veth pair. Rate (default 10gbit), one-way delay, and MTU are configurable; it emits the CI-identical CSV, renders the same plots via contrib/scripts/plot_*.pl, and collects out-of-band TCP statistics (MSS, per-connection segs/bytes, namespace OutSegs, average segment payload per direction) in a cross-rate summary table. Per-run outputs are <name>.csv, <name>-stderr.log (test-program stderr; empty on a clean run), <name>-net.csv, and <name>-net.txt. The harness also exposes QUANTUM (bytes or K/M/G suffix, e.g. 1M, 512K) and READAHEAD knobs that set the server's afp.conf 'server quantum' and 'dsireadbuf' for the run, so the quantum/read-ahead sweep can be driven end to end; the container entrypoint's afp.conf template gains those two options (AFP_SERVER_QUANTUM / AFP_DSIREADBUF, defaulting to afpd's built-in values). The plot's quantum label tracks the configured value instead of a hardcoded 1024, and reads KiB. Also fix the speedtest -d sentinel: -d 64 equalled the built-in default so the tool silently ran the default sweep; an explicit flag now always selects single-size mode (SizeFlagSeen). File sizes stay binary KiB/MiB, matching other AFP/SMB testing tools. Print size_t and off_t values with %ju/(uintmax_t) instead of %ld/%lu, clarify -q is KiB, forward the OPS knob from run_perftest.sh, and exclude the privileged harness from SonarQube analysis.
cc86862 to
7333b66
Compare
📊 Performance DashboardCommit: 🔥 Spectest (AFP 3.4) - FlameGraphNetatalk Code-time: 2.0% · Runtime: 67s · Stacks: 1162 🔥 Click the preview to open the interactive flamegraph (zoom + search). 🔝 Top 10 leaf functions
📈 Speedtest (AFP 3.4) - PerfGraph🔝 Peak throughput per operation
⏱️ Lantest (AFP 3.4) - LatencyGraphAvg total runtime: 6432 ms · Avg time per AFP op: 0.100 ms 🐢 All operations (avg runtime, in test order)
|
|
|
@rdmark with and without 3196 fixes added to summary. |






Adds a shaped-network performance test rig under
distrib/docker/perftest/: a container harness that runs afpd in the container's root network namespace, and runs the CI perfgraph speedtest (or lantest) from a separate client namespace in the same container across a tc-netem shaped veth pair.The CI Performance Dashboard charts can now be reproduced locally with configurable network properties; link rates (100mbit/1gbit/10gbit), RTT delay and MTU — providing a static, repeatable network environment instead of the CPU-bound loopback the CI runners use, so framing and alignment effects (runt packets, segment fill) show consistently and the number of packets exchanged is measurable.
Every sweep size runs as its own afp_speedtest invocation with the client veth's packet/byte counters sampled before and after the test, giving exact per-test-size network statistics in both directions (segmentation offloads disabled so counters see exact on-wire sized packets).
The per-size fragments are merged into one CSV identical in layout to a CI sweep run and rendered through the same plot scripts; network statistics stay in separate files and a per-size table, never in the CSV.
At 10gbit/MTU 1500 the average packet size gradient runs ~420 bytes at the smallest sweep size to ~1503 at 256 MB (shown as MTU not MSS), and back-to-back runs reproduce totals within 0.03% — precise enough to measure framing changes per size.
ServerCopy is excluded from the default operation set (server-side copy, never crosses the shaped link, visually dwarfs the wire-bound curves);
OPS=Read,Write,Copy,ServerCopyrestores the CI set.File sizes stay in binary KiB/MiB, matching macOS
rx_quantum, netatalk-client, and other AFP/SMB testing tools.Other fixes in this PR
-dsentinel:-d 64equalled the built-in default, so the tool silently ran the default size sweep instead of the single given value; an explicit flag now always selects single-size mode (SizeFlagSeen).size_t(Quantum) andoff_t(rwsize) are printed with%juand(uintmax_t)casts instead of%ld/%lu, which are wrong on platforms where those types are notlong.-qhelp text says KiB (it multiplies by 1024).OPSknob: forwarded fromrun_perftest.shinto the container soServerCopyand custom operation sets work from the host.Example Execution
./distrib/docker/perftest/run_perftest.sh RATE=10gbit DELAY=2msEvery knob at its default:
afp_speedtest sweep, 5 iterations + 1 warmup, ops Read/Write/Copy
rate limit 10gbit, forced delay 2ms (RTT 4ms), MTU 1500, MSS 1448, output to
perftest-results/Runs the whole pipeline: rebuilds netatalk-testsuite from the working tree, layers netatalk-perftest on top, runs the container with
--privileged(one per-size speedtest invocation per sweep point over the shaped veth), merges the CSV, rendersspeed-10gbit-2ms.pngvia plot_speedtest.pl on the host, and prints the summary plus per-size table.Results
NOTE; the recent performance regression have not been fixed here, and continue to be shown below (does not get up to speed until 16MB)
Summary
Per-size network statistics
Client veth: tx = client sends, rx = client receives.
Totals: 4,991,286 tx packets / 4,284,970 rx packets; whole-run averages 1,502 / 1,500 bytes (MTU) per packet. Average packet size includes TCP/IP headers and ACK-only packets: the on-wire maximum at MTU 1500 with ethernet framing is ~1,514, so the large-size rows are effectively wire-full, while the small and mid sizes carry the command round-trip and partial-frame overhead — the region where DSI framing changes will show.
Relationship to #3196
This harness was created to analyse and baseline the current codebase before fix #3196 (the DSI quantum / framing fixes) are merged, to provide a true before/after analysis using static network properties.
Ie, On binary file sizes against the current server (with regression), transfers that straddle the sub-quantum boundary still trail a runt frame.
I have run this new test harness on the #3196 branch and the results below validate the fixes;
This shows the same performance test as above on the fixed branch;

The green and yellow lines show the percentage increase in average packet size as a result of the new Quantum/MSS auto-scaling;
