Skip to content

Instantly share code, notes, and snippets.

@rjhowe
Last active March 10, 2025 18:42
Show Gist options
  • Save rjhowe/32db5519dc8812419a19533b372c4075 to your computer and use it in GitHub Desktop.
Save rjhowe/32db5519dc8812419a19533b372c4075 to your computer and use it in GitHub Desktop.
OpenShift 4 Network Performance Throughput Testing

OpenShift 4 Network Performance Throughput Testing

Issue

  • How do I do performance testing to test the network bewteen nodes and pods?
  • What tool does RedHat use to test network performance?

Environment

  • OpenShift 4

Resolution

k8s-netperf is a tool used by RedHat

Download: k8s-netperf_Linux_v0.1.27_x86_64.tar.gz

Image: quay.io/rjhowe/oc-k8s-netperf:latest

Label nodes

Apply a label to the nodes you want the client and server running

$ oc label nodes node-name netperf=client
$ oc label nodes node-name netperf=server

Run k8s-netperf from an image

$ podman run -it --rm --entrypoint /bin/k8s-netperf -v ~/.kube/config:/config:z -e KUBECONFIG=/config quay.io/rjhowe/oc-k8s-netperf:latest --all  --iperf --netperf

Sample test configuration

$ cat ./netperf.yml

tests :
  - TCPStream1:       
    parallelism: 1     
    profile: "TCP_STREAM" 
    duration: 10          
    samples: 3          
    messagesize: 1024     
    burst: 1               
    service: false   
  - TCPStream2:           
    parallelism: 1     
    profile: "TCP_STREAM" 
    duration: 10           
    samples: 3            
    messagesize: 4096   
    burst: 3                                                                                                                                                       
    service: false

Run test locally if binary is installed

$ k8s-netperf --config ./test.yml  --all  --iperf --netperf 

Output

+-------------------+---------+------------+-------------+--------------+---------+--------------+-------+-----------+----------+---------+--------------------+---------------------------------+
|    RESULT TYPE    | DRIVER  |  SCENARIO  | PARALLELISM | HOST NETWORK | SERVICE | MESSAGE SIZE | BURST | SAME NODE | DURATION | SAMPLES |     AVG VALUE      |     95% CONFIDENCE INTERVAL     |
+-------------------+---------+------------+-------------+--------------+---------+--------------+-------+-----------+----------+---------+--------------------+---------------------------------+
| πŸ“Š Stream Results | netperf | TCP_STREAM | 1           | true         | false   | 1024         | 1     | false     | 10       | 1       | 1361.230000 (Mb/s) | 0.000000-0.000000 (Mb/s)        |
| πŸ“Š Stream Results | netperf | TCP_STREAM | 1           | false        | false   | 1024         | 1     | false     | 10       | 1       | 563.400000 (Mb/s)  | 0.000000-0.000000 (Mb/s)        |
| πŸ“Š Stream Results | iperf3  | TCP_STREAM | 1           | true         | false   | 1024         | 1     | false     | 10       | 1       | 2573.913088 (Mb/s) | 0.000000-0.000000 (Mb/s)        |
| πŸ“Š Stream Results | iperf3  | TCP_STREAM | 1           | false        | false   | 1024         | 1     | false     | 10       | 1       | 501.386560 (Mb/s)  | 0.000000-0.000000 (Mb/s)        |
| πŸ“Š Stream Results | netperf | TCP_STREAM | 1           | true         | false   | 4096         | 3     | false     | 10       | 3       | 8199.230000 (Mb/s) | 6172.157062-10226.302938 (Mb/s) |
| πŸ“Š Stream Results | netperf | TCP_STREAM | 1           | false        | false   | 4096         | 3     | false     | 10       | 3       | 744.193333 (Mb/s)  | 690.455708-797.930959 (Mb/s)    |
| πŸ“Š Stream Results | iperf3  | TCP_STREAM | 1           | true         | false   | 4096         | 3     | false     | 10       | 3       | 8435.345749 (Mb/s) | 7369.573127-9501.118372 (Mb/s)  |
| πŸ“Š Stream Results | iperf3  | TCP_STREAM | 1           | false        | false   | 4096         | 3     | false     | 10       | 3       | 764.838613 (Mb/s)  | 712.099503-817.577723 (Mb/s)    |
+-------------------+---------+------------+-------------+--------------+---------+--------------+-------+-----------+----------+---------+--------------------+---------------------------------+
+---------------------+---------+------------+-------------+--------------+---------+--------------+-------+-----------+----------+---------+-------------+
|        TYPE         | DRIVER  |  SCENARIO  | PARALLELISM | HOST NETWORK | SERVICE | MESSAGE SIZE | BURST | SAME NODE | DURATION | SAMPLES |  AVG VALUE  |
+---------------------+---------+------------+-------------+--------------+---------+--------------+-------+-----------+----------+---------+-------------+
| TCP Retransmissions | netperf | TCP_STREAM | 1           | true         | false   | 1024         | 1     | false     | 10       | 1       | 0.000000    |
| TCP Retransmissions | netperf | TCP_STREAM | 1           | false        | false   | 1024         | 1     | false     | 10       | 1       | 89.000000   |
| TCP Retransmissions | iperf3  | TCP_STREAM | 1           | true         | false   | 1024         | 1     | false     | 10       | 1       | 25.000000   |
| TCP Retransmissions | iperf3  | TCP_STREAM | 1           | false        | false   | 1024         | 1     | false     | 10       | 1       | 97.000000   |
| TCP Retransmissions | netperf | TCP_STREAM | 1           | true         | false   | 4096         | 3     | false     | 10       | 3       | 3826.666667 |
| TCP Retransmissions | netperf | TCP_STREAM | 1           | false        | false   | 4096         | 3     | false     | 10       | 3       | 109.333333  |
| TCP Retransmissions | iperf3  | TCP_STREAM | 1           | true         | false   | 4096         | 3     | false     | 10       | 3       | 2341.666667 |
| TCP Retransmissions | iperf3  | TCP_STREAM | 1           | false        | false   | 4096         | 3     | false     | 10       | 3       | 86.666667   |
+---------------------+---------+------------+-------------+--------------+---------+--------------+-------+-----------+----------+---------+-------------+
ERRO[2025-03-05 16:51:49] πŸ˜₯ TCP Single Stream (Message Size : 1024) percent difference when comparing hostNetwork to podNetwork is greater than 10.0 percent (134.8 percent) for 1 streams 
ERRO[2025-03-05 16:51:49] πŸ˜₯ TCP Single Stream (Message Size : 1024) percent difference when comparing hostNetwork to podNetwork is greater than 10.0 percent (134.8 percent) for 1 streams 
ERRO[2025-03-05 16:51:49] πŸ˜₯ TCP Single Stream (Message Size : 4096) percent difference when comparing hostNetwork to podNetwork is greater than 10.0 percent (166.7 percent) for 1 streams 
ERRO[2025-03-05 16:51:49] πŸ˜₯ TCP Single Stream (Message Size : 4096) percent difference when comparing hostNetwork to podNetwork is greater than 10.0 percent (166.7 percent) for 1 streams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment