Been super busy, and I haven’t ever gotten back to address this point. Your opinion here is fine, but lets do some testing.
On my EPYC system using /dev/zero and /dev/null I can get 23.2GB/s of bandwidth, showing my maximum CPU/RAM/Platform performance for a single-threaded operation.
root@prod:~# dd if=/dev/zero of=/dev/null bs=1M status=progress
208967565312 bytes (209 GB, 195 GiB) copied, 9 s, 23.2 GB/s
On my Xeon Silver 4114 system, I can get 13.3GB/s
root@notprod[~]# dd if=/dev/zero of=/dev/null bs=1M status=progress
239755853824 bytes (240 GB, 223 GiB) copied, 18 s, 13.3 GB/s^C
228679+0 records in
228679+0 records out
239787311104 bytes (240 GB, 223 GiB) copied, 18.0025 s, 13.3 GB/
In either case, the performance here shows pretty convincingly that I’m not artificially limiting the tn-bench results with some sort of psuedo bottleneck by using dd or by using /dev/null.
What I mean is, the overall performance of this operation is still an order of magnitude or more faster than reading from any single disk in a similar fashion. While it is true this is single thread performance locked, we can also test multiple threads in a similar way to tn-bench to prove that it’s design is scalable. 240.00 GiB/s? Not bad, considering this servers actively in production doing other things.
root@prod:~# ./quick.sh
Starting 12 threads, each copying 200 GiB...
All threads completed in 10 seconds
Approximate aggregate bandwidth: 240.00 GiB/s
root@prod:~#
All threads completed in 10 seconds
Approximate aggregate bandwidth: 240.00 GiB/s
root@prod:~# cat quick.sh
#!/bin/bash
# Config
threads=12
bs=$((1*1024*1024)) # 1 MiB block
bytes_per_thread=$((200*1024**3)) # 200 GiB
count=$((bytes_per_thread / bs))
# Temporary directory for progress tracking
tmpdir=$(mktemp -d)
trap "rm -rf $tmpdir" EXIT
echo "Starting $threads threads, each copying 200 GiB..."
start=$(date +%s)
# Launch threads
for i in $(seq 1 $threads); do
progfile="$tmpdir/prog_$i"
echo 0 > "$progfile"
dd if=/dev/zero of=/dev/null bs=$bs count=$count status=progress 2>&1 | \
awk -v f="$progfile" '/bytes copied/ { gsub(/[,]/,""); print int($1/1024/1024) > f; fflush(f) }' &
done
# Live aggregate bandwidth reporter
(
while kill -0 $(jobs -p) 2>/dev/null; do
total_mb=0
for f in "$tmpdir"/prog_*; do
[[ -f $f ]] && read -r mb < "$f"
total_mb=$((total_mb + mb))
done
elapsed=$(( $(date +%s) - start ))
[[ $elapsed -eq 0 ]] && elapsed=1
gb_s=$(awk "BEGIN{printf \"%.2f\", $total_mb/1024/$elapsed}")
echo -ne "Elapsed: ${elapsed}s | Aggregate: ${gb_s} GB/s\r"
sleep 1
done
) &
# Wait for all threads
wait
end=$(date +%s)
elapsed=$((end-start))
# Final aggregate bandwidth
total_gib=$((bytes_per_thread*threads/1024**3))
echo
echo "All threads completed in $elapsed seconds"
echo "Approximate aggregate bandwidth: $(awk "BEGIN{printf \"%.2f\", $total_gib/$elapsed}") GiB/s"
Other system
root@notprod[~]# ./quick.shStarting 12 threads, each copying 200 GiB…
All threads completed in 23 secondsApproximate aggregate bandwidth: 104.35 GiB/s
All this to say, I disagree with your opinion that using /dev/null is somehow invalid. 