aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/019-idle-links/run.py
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-29 16:13:48 +0100
committereunhhu <[email protected]>2026-09-29 16:13:48 +0100
commit1e562fb73527adb46a6ce8f4f302e22460aedf95 (patch)
tree1fda2af52fe8dee2232a00f82407c2f2ff5159a7 /research/experiments/019-idle-links/run.py
parent500ab6a026c5cb39e04ed74c0cbdf9d482035413 (diff)
downloadpure-1e562fb73527adb46a6ce8f4f302e22460aedf95.tar.gz
pure-1e562fb73527adb46a6ce8f4f302e22460aedf95.zip
Put ngtcp2 beside quinn in M5, as the design planned
ngtcp2 1.25.0 with OpenSSL 3.5's QUIC TLS (its ossl backend), fetched and built into build/third by ngtcp2/build.sh; drain.c does in C what the quinn harness does: one connection, one stream, "pure" and then the messages each after its u32 length, counted by the service, packets in GSO bursts. Its stream bytes are a function of their offset, so what ngtcp2 keeps to send again points into a pattern that never changes. run.py's drain_ngtcp2 measures both sides' CPU as drain_quic does. Five rounds each, both sides' CPU a message: 61 B Pure 0.280, ngtcp2 0.270, quinn 0.310 us; 1 KiB 2.62, 3.54, 3.94; 16 KiB 40.2, 54.4, 60.2.
Diffstat (limited to 'research/experiments/019-idle-links/run.py')
-rw-r--r--research/experiments/019-idle-links/run.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/research/experiments/019-idle-links/run.py b/research/experiments/019-idle-links/run.py
index 7f2647d..0d18c1d 100644
--- a/research/experiments/019-idle-links/run.py
+++ b/research/experiments/019-idle-links/run.py
@@ -543,6 +543,26 @@ def drain_quic(work, n, size):
return row
+def drain_ngtcp2(work, n, size):
+ """The same over ngtcp2 (ngtcp2/drain.c, OpenSSL 3.5's QUIC TLS): one
+ connection, one stream, n messages; CPU of both sides."""
+ import resource
+ binary = ROOT / 'build/third/ngtcp2-drain'
+ server, info = start([binary, 'serve', work / 'cert.der', work / 'key.der'])
+ before, children = thread_cpu(server.pid, None), resource.getrusage(resource.RUSAGE_CHILDREN)
+ client = subprocess.run([str(binary), 'drain', str(info['port']), str(n), str(size + 8 + 5)], capture_output=True,
+ timeout=600)
+ after = resource.getrusage(resource.RUSAGE_CHILDREN)
+ row = json.loads(client.stdout)
+ server_cpu = thread_cpu(server.pid, None) - before
+ client_cpu = (after.ru_utime + after.ru_stime - children.ru_utime - children.ru_stime) * 1000
+ row['client_cpu_us_per_message'] = round(client_cpu * 1000 / n, 2)
+ server.kill()
+ server.wait()
+ row['service_cpu_us_per_message'] = round(server_cpu * 1000 / n, 2)
+ return row
+
+
def transport(work, size, n):
"""The transport alone (transport.c): a backlog of n records of an order
with a size-byte item drained through a link and a listener in one