Closed mahalakshmi27 closed 6 years ago
Hi @mahalakshmi27, I tried to reproduce the issue but could not on my own machine. I did notice you set the server_hostname to 0.0.0.0 instead of a string "0.0.0.0" which won't work. Here's a quick test I did myself:
$ cat temptest.py
import iperf3
print('1')
client = iperf3.Client()
client.server_hostname = "127.0.0.1"
client.duration = 2
client.num_streams = 5
client.json_output = True
print('2')
response = client.run()
print(response.sent_Mbps)
print('3')
Output:
1
2
19713.14
3
Without seeing your full code I'm not sure if this is your actual problem. It looks like you are trying to run this in a separate Process, perhaps launching multiple sessions at the same time?
I can confirm this problem. It's really exist.
def start_test(hostname, port, duration=1):
print("start_test")
client = iperf3.Client()
client.duration = duration
client.reverse = True
client.num_streams = 16
client.server_hostname = hostname
client.port = port
client.verbose = True
return client.run()
There is my code. If I call function as start_test("iperf.perm.rtsd.ru", "5256")
. Everything is ok.
But code stuck if I call start_test("iperf.perm.rtsd.ru", "5256", 20)
iperf version:
iperf 3.1.3 Linux vasiliyrusin 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64 Optional features available: CPU affinity setting, IPv6 flow label, TCP congestion algorithm setting, sendfile / zerocopy, socket pacing
Running Iperf with 5 parallel streams(TCP) does not work while running the same code with a single connection works fine.
CODE SNIPPET:
OUTPUT:
1
2
It does not reach "print('3')" line. I pressed Ctrl+C after waiting for several minutes and only this was printed:
KeyboardInterrupt