[Fuego] [PATCH 5/5] iperf3: add retries if the server is busy

Tim.Bird at sony.com Tim.Bird at sony.com
Tue Mar 20 04:18:58 UTC 2018


I have some questions.
See below.

> -----Original Message-----
> From: Daniel Sangorrin
> 
> The iperf3 server can only serve iperf3 clients one at a time.
> For that reason, running the test on multiple boards at the
> same time would end up in an error for all boards except the
> one that arrived first.
> 
> One solution would be to start multiple servers using
> different ports, and asking Fuego users to write the default
> port on their board files.
> 
> Here I am taking another solution that does not require
> doing that and therefore is less confusing. The idea is
> to allow iperf3 clients to retry the connection several
> times (with 30 seconds intervals). This approach also has the
> benefit that by ensuring that only one test can run at the
> same time, the cpu/network utilization of the server is not
> affected by other boards.

Regarding the general approach: it looks like this code waits about
3 minutes.  How long does the average iperf test take?  Is a 3-minute
timeout waiting for the service sufficient?

What happens if multiple clients attempt iperf simultaneously?
It would be better if we waited 3 minutes, but reset the counter
if we determined that a different client was using the server.  This
could create a potentially long busywait (even an indefinite wait
in the worst case).  But that might be preferable to erroring out
if there happen to be multiple collisions on the server.
I'm guessing that would be extremely difficult to implement, so maybe
we'll just have to live with occasional retry exhaustion.

> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
> ---
>  engine/tests/Benchmark.iperf3/fuego_test.sh | 21 ++++++++++++++++++-
> --
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/engine/tests/Benchmark.iperf3/fuego_test.sh
> b/engine/tests/Benchmark.iperf3/fuego_test.sh
> index 4c27ce1..528eba8 100755
> --- a/engine/tests/Benchmark.iperf3/fuego_test.sh
> +++ b/engine/tests/Benchmark.iperf3/fuego_test.sh
> @@ -19,9 +19,24 @@ function test_run {
>          echo "ERROR: set the server ip on the spec or board file"
>          return 1
>      fi
> -    echo "Using server ip address: $IPERF3_SERVER_IP"
> -    echo "Starting iperf3 client on the target (CLIENT IP: $IPADDR)"
> -    cmd "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./iperf3 -V -c
> $IPERF3_SERVER_IP -f M -J --logfile
> $BOARD_TESTDIR/fuego.$TESTDIR/output.json --get-server-output
> $BENCHMARK_IPERF3_CLIENT_PARAMS"
> +
> +    echo "Starting iperf3 client on the target (CLIENT IP: $IPADDR, SERVER IP:
> $IPERF3_SERVER_IP)"
> +    json_file=$(mktemp)
maybe do the following:

IPERF_RETRIES=6
IPERF_RETRY_LIST=$(seq $IPERF_RETRIES)
for I in ${IPERF_RETRY_LIST}; do

This would isolate the retry count to one location in the code.

> +    for i in 1 2 3 4 5 6; do
> +        cmd "$BOARD_TESTDIR/fuego.$TESTDIR/iperf3 -V -c
> $IPERF3_SERVER_IP -J --logfile
> $BOARD_TESTDIR/fuego.$TESTDIR/output.json --get-server-output
> $BENCHMARK_IPERF3_CLIENT_PARAMS" && break || \

Are there other reasons the command might fail, that we can detect,
besides server busy?  Is there an exit code for that specific case, or
are we just using any failure as possible indicator that the server is
busy?

> +            echo "The server seems busy running another iperf3 test. Trying again
> in 30 seconds"
> +
> +        # that was our last try so abort the job
> +        if [ $i -eq 6 ]; then
I prefer a '-ge', purely for style sake.

If using the above, maybe:
    if [ $i -ge $IPERF_RETRIES ]; then

> +            abort_job "The server seems busy running another iperf3 test."
> +        fi
> +
> +        # remove the json file before retrying, otherwise it gets appended
> +        cmd "rm -f $BOARD_TESTDIR/fuego.$TESTDIR/output.json"
> +        sleep 30
> +    done
> +    rm -f $json_file
> +
>      report "cat $BOARD_TESTDIR/fuego.$TESTDIR/output.json"
>  }
> 
> --
> 2.7.4

Thanks.
 -- Tim


More information about the Fuego mailing list