Handle multiple nodes in cluster

This commit is contained in:
Pascal Engélibert 2026-06-29 16:29:47 +02:00
commit e6719ab571
5 changed files with 295 additions and 237 deletions

48
exp.py
View file

@ -131,9 +131,9 @@ CONFIGS = {
True,
],
"records": [
#{ "filename": "wp2", "repeat": 10000, "time": 600, "reproduce": 1 },
{ "filename": "yt2-ads", "repeat": 10000, "time": 600, "reproduce": 1 },
{ "filename": "yt2-ublock", "repeat": 10000, "time": 600, "reproduce": 1 },
{ "filename": "wp2", "repeat": 10000, "time": 600, "reproduce": 1 },
{ "filename": "yt2-ads", "repeat": 10000, "time": 1200, "reproduce": 1 },
{ "filename": "yt2-ublock", "repeat": 10000, "time": 1200, "reproduce": 1 },
#{ "filename": "wp2", "repeat": 10000, "time": 300, "reproduce": 100 },
],
"repo_dir": "/home/tuxmain/reps/tlsbench",
@ -166,17 +166,17 @@ CONFIGS = {
#"debug",
],
"sides": [
"client",
#"client",
"server",
],
"tls": [
False,
#True,
#False,
True,
],
"records": [
{ "filename": "wp2", "repeat": 10000, "time": 300, "reproduce": 3 },
{ "filename": "yt2-ads", "repeat": 10000, "time": 300, "reproduce": 3 },
{ "filename": "yt2-ublock", "repeat": 10000, "time": 300, "reproduce": 3 },
#{ "filename": "wp2", "repeat": 10000, "time": 600, "reproduce": 1 },
{ "filename": "yt2-ads", "repeat": 10000, "time": 600, "reproduce": 1 },
{ "filename": "yt2-ublock", "repeat": 10000, "time": 600, "reproduce": 1 },
#{ "filename": "test", "repeat": 1, "time": 10 },
#{ "filename": "wp2", "repeat": 10000, "time": 300, "reproduce": 100 },
],
@ -348,13 +348,13 @@ CERT_SIGN_ALGS = [
"rsa2048", "rsa3072", "rsa4096", # widely used
]
IMPLS = [
"aws-lc", # Amazon's crypto widely used in Rust stuff
#"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", # widely used
#"openssl-static",
#"ring", # used in most Rust stuff
#"symcrypt", # Microsoft's crypto
"ring", # used in most Rust stuff
"symcrypt", # Microsoft's crypto
]
# Symmetric ciphers
# They also allow to choose the TLS version.
@ -785,6 +785,9 @@ def run_exp(config, only_record=None, idle=False, shutdown=False, debug=False):
if idle:
print("Measuring idle...")
remote_bytes_in, remote_bytes_out = get_net_stat(ssh)
controller_bytes_in, controller_bytes_out = (0, 0)
if config["measure_both"]:
controller_bytes_in, controller_bytes_out = get_net_stat(None)
energy = 0
energy_rapl = 0
if config["wattmeter"]:
@ -803,8 +806,13 @@ def run_exp(config, only_record=None, idle=False, shutdown=False, debug=False):
if config["rapl"]:
new_energy_rapl = get_rapl_energy(ssh, remote_path)
new_remote_bytes_in, new_remote_bytes_out = get_net_stat(ssh)
new_controller_bytes_in, new_controller_bytes_out = (0, 0)
if config["measure_both"]:
new_controller_bytes_in, new_controller_bytes_out = get_net_stat(None)
remote_bytes_in_diff = new_remote_bytes_in - remote_bytes_in
remote_bytes_out_diff = new_remote_bytes_out - remote_bytes_out
controller_bytes_in_diff = new_controller_bytes_in - controller_bytes_in
controller_bytes_out_diff = new_controller_bytes_out - controller_bytes_out
energy_diff = new_energy - energy
energy_rapl_diff = new_energy_rapl - energy_rapl
time_diff = end - start
@ -812,6 +820,9 @@ def run_exp(config, only_record=None, idle=False, shutdown=False, debug=False):
try:
with open(logfile_path, "a") as logfile:
logfile.write(f"{target} idle - - - - - - - - - {start} {end} {time_diff} 0 {remote_bytes_in_diff} {remote_bytes_out_diff} {energy_diff} {energy_rapl_diff} -\n")
if config["measure_both"]:
controller_target = config["controller_target"]
logfile.write(f"{controller_target} idle - - - - - - - - - {start} {end} {time_diff} 0 {controller_bytes_in_diff} {controller_bytes_out_diff} 0 0 -\n")
logfile.close()
break
except Exception as e:
@ -1098,6 +1109,7 @@ Run options:
--idle Also measure when idle
--shutdown Shutdown host and target when finished
--debug Print netreplay's debug
-f <file> JSON file to update config
""".format(
sig_algs = " ".join(CERT_SIGN_ALGS),
configs = " ".join([i for i in CONFIGS]),
@ -1121,6 +1133,16 @@ Run options:
update_certs(config)
elif opt == "run":
config = CONFIGS[sys.argv[2]]
add_config_file = getargv("-f")
if add_config_file:
import json
f = open(add_config_file, "r")
j = json.load(f)
f.close()
for k in j:
config[k] = j[k]
if "--count" in sys.argv:
exps = 0
for expname in config["experiments"]: