An Alpine Linux iperf3 Docker build for Network Testing.
1.4K
$ docker run -it --rm -p 5201:5201 slashdoom/iperf3 --help
To test bandwidth between two containers, start a server (listener) and point a client container (initiator) at the server.
Start a listener service on port 5201 and name the container "iperf3-server":
$ docker run -it --rm --name=iperf3-server -p 5201:5201 slashdoom/iperf3 -s
This creates an iperf3 process bound to port 5201 waiting for new connections:
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------`
First, get the IP address of the new server container you just started:
$ docker inspect --format "{{ .NetworkSettings.IPAddress }}" iperf3-server
172.17.0.2 <~~ returned container IP
Next, initiate a client connection from another container to measure the bandwidth between the two endpoints.
Run a client container pointing at the server container's IP address.
$ docker run -it --rm slashdoom/iperf3 -c 172.17.0.2
And the output is the following:
Connecting to host 172.17.0.2, port 5201
[ 5] local 172.17.0.3 port 50800 connected to 172.17.0.2 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 6.39 GBytes 54.9 Gbits/sec 47 1.65 MBytes
[ 5] 1.00-2.00 sec 7.25 GBytes 62.3 Gbits/sec 0 1.65 MBytes
[ 5] 2.00-3.00 sec 6.63 GBytes 57.0 Gbits/sec 0 1.65 MBytes
[ 5] 3.00-4.00 sec 7.80 GBytes 67.0 Gbits/sec 0 1.65 MBytes
[ 5] 4.00-5.00 sec 7.34 GBytes 63.0 Gbits/sec 0 1.65 MBytes
[ 5] 5.00-6.00 sec 7.09 GBytes 60.9 Gbits/sec 1 1.65 MBytes
[ 5] 6.00-7.00 sec 6.67 GBytes 57.3 Gbits/sec 0 1.65 MBytes
[ 5] 7.00-8.00 sec 6.61 GBytes 56.7 Gbits/sec 0 1.65 MBytes
[ 5] 8.00-9.00 sec 6.45 GBytes 55.4 Gbits/sec 0 1.65 MBytes
[ 5] 9.00-10.00 sec 6.56 GBytes 56.3 Gbits/sec 0 1.65 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 68.8 GBytes 59.1 Gbits/sec 48 sender
[ 5] 0.00-10.00 sec 68.8 GBytes 59.1 Gbits/sec receiver
iperf Done.
Content type
Image
Digest
sha256:37e23f412…
Size
4.4 MB
Last updated
about 1 year ago
docker pull slashdoom/iperf3