From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top, Stefano Brivio <sbrivio@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 8/8] test/perf: Simplify calculation of "omit" time for TCP throughput
Date: Mon, 6 Nov 2023 18:08:33 +1100 [thread overview]
Message-ID: <20231106070834.1270986-9-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20231106070834.1270986-1-david@gibson.dropbear.id.au>
For the TCP throughput tests, we use iperf3's -O "omit" option which
ignores results for the given time at the beginning of the test. Currently
we calculate this as 1/6th of the test measurement time. The purpose of
-O, however, is to skip over the TCP slow start period, which in no way
depends on the overall length of the test.
The slow start time is roughly speaking
log_2 ( max_window_size / MSS ) * round_trip_time
These factors all vary between tests and machines we're running on, but we
can estimate some reasonable bounds for them:
* The maximum window size is bounded by the buffer sizes at each end,
which shouldn't exceed 16MiB
* The mss varies with the MTU we use, but the smallest we use in tests is
~256 bytes
* Round trip time will vary with the system, but with these essentially
local transfers it will typically be well under 1ms (on my laptop it is
closer to 0.03ms)
That gives a worst case slow start time of about 16ms. Setting an omit
time of 0.1s uniformly is therefore more than enough, and substantially
smaller than what we calculate now for the default case (10s / 6 ~= 1.7s).
This reduces total time for the standard benchmark run by around 30s.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
test/perf/passt_tcp | 2 +-
test/perf/pasta_tcp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/perf/passt_tcp b/test/perf/passt_tcp
index da4e369..631a407 100644
--- a/test/perf/passt_tcp
+++ b/test/perf/passt_tcp
@@ -40,7 +40,7 @@ hout FREQ [ -n "__FREQ_CPUFREQ__" ] && echo __FREQ_CPUFREQ__ || echo __FREQ_PROC
set THREADS 1
set STREAMS 8
set TIME 10
-hout OMIT echo __TIME__ / 6 | bc -l
+set OMIT 0.1
set OPTS -Z -P __STREAMS__ -l 1M -O__OMIT__
info Throughput in Gbps, latency in µs, one thread at __FREQ__ GHz, __STREAMS__ streams
diff --git a/test/perf/pasta_tcp b/test/perf/pasta_tcp
index 11c73f8..7777532 100644
--- a/test/perf/pasta_tcp
+++ b/test/perf/pasta_tcp
@@ -24,7 +24,7 @@ ns /sbin/sysctl -w net.ipv4.tcp_timestamps=0
set THREADS 2
set STREAMS 2
set TIME 10
-hout OMIT echo __TIME__ / 6 | bc -l
+set OMIT 0.1
set OPTS -Z -w 4M -l 1M -P __STREAMS__ -O__OMIT__
hout FREQ_PROCFS (echo "scale=1"; sed -n 's/cpu MHz.*: \([0-9]*\)\..*$/(\1+10^2\/2)\/10^3/p' /proc/cpuinfo) | bc -l | head -n1
--
@@ -24,7 +24,7 @@ ns /sbin/sysctl -w net.ipv4.tcp_timestamps=0
set THREADS 2
set STREAMS 2
set TIME 10
-hout OMIT echo __TIME__ / 6 | bc -l
+set OMIT 0.1
set OPTS -Z -w 4M -l 1M -P __STREAMS__ -O__OMIT__
hout FREQ_PROCFS (echo "scale=1"; sed -n 's/cpu MHz.*: \([0-9]*\)\..*$/(\1+10^2\/2)\/10^3/p' /proc/cpuinfo) | bc -l | head -n1
--
2.41.0
next prev parent reply other threads:[~2023-11-06 7:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 7:08 [PATCH 0/8] Clean ups and speed ups to benchmarks David Gibson
2023-11-06 7:08 ` [PATCH 1/8] test/perf: Remove stale iperf3c/iperf3s directives David Gibson
2023-11-06 7:08 ` [PATCH 2/8] test/perf: Get iperf3 stats from client side David Gibson
2023-11-06 7:08 ` [PATCH 3/8] test/perf: Start iperf3 server less often David Gibson
2023-11-06 7:08 ` [PATCH 4/8] test/perf: Small MTUs for spliced TCP aren't interesting David Gibson
2023-11-06 7:08 ` [PATCH 5/8] test/perf: Explicitly control UDP packet length, instead of MTU David Gibson
2023-11-06 7:08 ` [PATCH 6/8] test/perf: "MTU" changes in passt_tcp host to guest aren't useful David Gibson
2023-11-06 7:08 ` [PATCH 7/8] test/perf: Remove unnecessary --pacing-timer options David Gibson
2023-11-06 7:08 ` David Gibson [this message]
2023-11-07 12:45 ` [PATCH 0/8] Clean ups and speed ups to benchmarks Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231106070834.1270986-9-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).