Tuning Network Performance
1. Testing performance with iperf3
Before doing any modifications, you can test the traffic throughput with the following iperf3 commands:
1.2. UDP
# iperf3 -c <ip> -u -b0 # iperf3 -c <ip> -u -b0 -l 10000 // with size 10000 # iperf3 -c <ip> -u -b0 --bidir
TX and RX unidirectional traffic is tested by either initiating the connection from the switch or from the remote partner. In case of testing RX unidirectional traffic, you start a server on the switch by issuing the following iperf3 command:
# iperf3 -s <dev>
2. Tuning UDP connections
2.1. Increasing the system-wide UDP socket buffers
If UDP packets are sent or received at a too fast rate, the kernel will drop any new incoming UDP packets, until enough room is again available in the buffers. In this case, it can help to increase the system-wide UDP socket buffers, to allow for more packets to queue up, before being dropped.
# sysctl net.core.rmem_default=104857600 // 100 MB # sysctl net.core.rmem_max=104857600 // 100 MB
2.2. Change MTU size for increased UDP traffic throughput
It is possible to increase UDP traffic throughput, by increasing the MTU, and
thereby reducing the frame overhead. This can have a great impact on UDP
performance. Currently the following platforms support changing the MTU:
lan966x, lan966-pci
.
# ip link set dev <dev> mtu 10000