Fix session count, concurrency, improve summary

This commit is contained in:
Pascal Engélibert 2026-04-08 16:43:21 +02:00
commit eba08d3b8b
4 changed files with 103 additions and 38 deletions

36
exp.py
View file

@ -87,7 +87,7 @@ CONFIGS = {
True,
],
"records": [
#{ "filename": "wikipedia", "repeat": 10000, "time": 90 },
{ "filename": "wp2", "repeat": 10000, "time": 600 },
{ "filename": "yt2-ads", "repeat": 10000, "time": 600 },
{ "filename": "yt2-ublock", "repeat": 10000, "time": 600 },
],
@ -107,6 +107,7 @@ CONFIGS = {
"idle": "idle - - - - - - - - - - - 600.000081539154 0.0 896 4792 0.5399999999999991 0 -",
"notify_listen": ("0.0.0.0", 8090),
"notify_addr": "192.168.3.1:8090",
"concurrency": "4",
},
# i7-4790 -> core2
"core2": {
@ -189,11 +190,13 @@ CONFIGS = {
"server",
],
"tls": [
False,
#False,
True,
],
"records": [
{ "filename": "wikipedia", "repeat": 1000 },
{ "filename": "wp2", "repeat": 10000, "time": 600 },
{ "filename": "yt2-ads", "repeat": 10000, "time": 600 },
{ "filename": "yt2-ublock", "repeat": 10000, "time": 600 },
],
"repo_dir": "/home/tuxmain/reps/tlsbench",
"exp_dir": "/dev/shm/exp",
@ -281,7 +284,7 @@ CONFIGS = {
"rapl": False,
"sa": False,
"listen_port": 8080,
"idle": "idle - - - - - - - - - 1772205368.593937 1772206568.6941307 1200.1001937389374 0 298843 2217803 5.53333333333333 0 -",
"idle": "idle - - - - - - - - - 1774429500.8909554 1774430100.9141996 600.0232441425323 0 222346 1105446 8.666666666666666 0 -",
"notify_listen": ("0.0.0.0", 8090),
"notify_addr": "TODO:8090",
"ld_preload": {
@ -343,12 +346,12 @@ CERT_SIGN_ALGS = [
"rsa2048", "rsa3072", "rsa4096", # widely used
]
IMPLS = [
"aws-lc", # Amazon's crypto widely used in Rust stuff
"boring", # Google's fork of OpenSSL used in Chrome and Android
#"aws-lc", # Amazon's crypto widely used in Rust stuff
#"boring", # Google's fork of OpenSSL used in Chrome and Android
#"graviola", # New crypto in Rust
"openssl", # widely used
#"openssl-static",
"ring", # used in most Rust stuff
#"ring", # used in most Rust stuff
#"symcrypt", # Microsoft's crypto
#"wolfcrypt" # used in embedded (won't build with rpxy for now)
]
@ -637,7 +640,10 @@ def run_netreplay_server(ssh, exp_dir, repo_dir, record, listen_addr, listen_por
#print(cmdline)
return ssh_run_bg(ssh, cmdline, env)
def run_netreplay_client(ssh, exp_dir, repo_dir, record, remote_addr, remote_port, tls, impl, certs_dir, only_record=None, ciphers=None, kexes=None, earlydata="0", debug=False, notify_addr=None, ld_preload=None, skip_verif=False):
def run_netreplay_client(
ssh, exp_dir, repo_dir, record, remote_addr, remote_port, tls, impl, certs_dir,
only_record=None, ciphers=None, kexes=None, earlydata="0", debug=False, notify_addr=None, ld_preload=None, skip_verif=False, concurrency=None
):
if exp_dir[-1] != "/":
exp_dir += "/"
repo_dir = repo_dir.removesuffix("/")
@ -661,6 +667,8 @@ def run_netreplay_client(ssh, exp_dir, repo_dir, record, remote_addr, remote_por
cmd += ["-n", notify_addr]
if skip_verif:
cmd.append("-s")
if concurrency != None:
cmd += ["--concurrency", concurrency]
cmdline = " ".join(cmd)
#print(cmdline)
return ssh_run_bg(ssh, cmdline, env)
@ -876,6 +884,7 @@ def run_exp(config, only_record=None, idle=False, shutdown=False, debug=False):
debug=debug,
notify_addr=config["notify_addr"],
ld_preload=config["ld_preload"] if "ld_preload" in config else None,
concurrency=config.get("concurrency"),
)
else:
netreplay = run_netreplay_server(
@ -912,6 +921,7 @@ def run_exp(config, only_record=None, idle=False, shutdown=False, debug=False):
notify_addr=config["notify_addr"],
ld_preload=config["ld_preload"] if "ld_preload" in config else None,
skip_verif=True,
concurrency=config.get("concurrency"),
)
prof_filename = "-"
@ -942,6 +952,8 @@ def run_exp(config, only_record=None, idle=False, shutdown=False, debug=False):
if rec_count == 0xffffffff:
break
if rec_count > session_count:
if rec_count - session_count > 1:
print("count", session_count, "->", rec_count)
session_count = rec_count
except Timeout:
print("TIMEOUT: stop")
@ -962,6 +974,14 @@ def run_exp(config, only_record=None, idle=False, shutdown=False, debug=False):
ssh_run(ssh, "killall netreplay-"+impl)
except invoke.exceptions.UnexpectedExit as e:
pass
# flush the UDP queue
signal.alarm(2)
try:
while True:
notify_socket.recv(4)
except Timeout:
pass
# Measure CPU after (as it may update only after the process is killed)
new_cpu = 0