Adds iperf timeout for bandwith measurements.

This commit is contained in:
Lukas Prause
2022-10-14 13:00:44 +02:00
parent 1c40864ff2
commit 9b50b91388

View File

@@ -369,10 +369,13 @@ class Server:
self.config["server"], self.config["server"],
self.config["port"], self.config["port"],
) )
try: is_measurement_done = False
subprocess.call(iperf_command, timeout=float(time) + 1 + TIMEOUT_OFFSET) while not is_measurement_done:
except: try:
print_message("iPerf timed out. Going ahead with next measurement...") subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
is_measurement_done = True
except:
print_message("iPerf timed out. Retry...")
processHandler.kill_all() processHandler.kill_all()
congestion_control_index = (congestion_control_index + 1) % len( congestion_control_index = (congestion_control_index + 1) % len(
tcp_algo tcp_algo
@@ -441,10 +444,13 @@ class Server:
str(self.config["port"]), str(self.config["port"]),
"--one-off", "--one-off",
] ]
try: is_measurement_done = False
subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET) while not is_measurement_done:
except: try:
print_message("iPerf timed out. Going ahead with next measurement...") subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
is_measurement_done = True
except:
print_message("iPerf timed out. Retry...")
sleep(2) sleep(2)
processHandler.kill_all() processHandler.kill_all()
congestion_control_index = (congestion_control_index + 1) % len( congestion_control_index = (congestion_control_index + 1) % len(
@@ -807,10 +813,13 @@ class Client:
"-C", "-C",
tcp_algo[congestion_control_index], tcp_algo[congestion_control_index],
] ]
try: is_measurement_done = False
subprocess.call(iperf_command, timeout=float(time) + 2 + TIMEOUT_OFFSET) while not is_measurement_done:
except: try:
print_message("iPerf timed out. Going ahead with next measurement...") subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
is_measurement_done = True
except:
print_message("iPerf timed out. Retry...")
sleep(4) sleep(4)
processHandler.kill_all() processHandler.kill_all()
congestion_control_index = (congestion_control_index + 1) % len( congestion_control_index = (congestion_control_index + 1) % len(
@@ -865,10 +874,13 @@ class Client:
self.config["port"], self.config["port"],
) )
sleep(2) sleep(2)
try: is_measurement_done = False
subprocess.call(iperf_command, timeout=float(time)+ 2 + TIMEOUT_OFFSET) while not is_measurement_done:
except: try:
print_message("iPerf timed out. Going ahead with next measurement...") subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
is_measurement_done = True
except:
print_message("iPerf timed out. Retry...")
processHandler.kill_all() processHandler.kill_all()
congestion_control_index = (congestion_control_index + 1) % len( congestion_control_index = (congestion_control_index + 1) % len(
tcp_algo tcp_algo