Kubernetes intra node TCP higher throughput than UDP #1273
Replies: 4 comments
-
Have you tried using the -w option to increase the socket buffer size? Maybe try 64K and increase it from there. |
Beta Was this translation helpful? Give feedback.
-
Also, TCP default packet size is 128KB and UDP default packet size is about 1.5KB. To compare apples to apples both should be the same. Try for example testing both TCP and UDP using |
Beta Was this translation helpful? Give feedback.
-
Thank you for your replies. When using -l 32K for both UDP and TCP there remains a difference in throughput:
iperf3 -c 172.12.1.6 -u -b 0 -l 32K
Increasing the socket buffer size does not have a much effect on the throughput as far as I can tell:
iperf3 -c 172.12.1.6 -u -b 0 -w 128K
|
Beta Was this translation helpful? Give feedback.
-
It seems that the UDP throughput is in the sending side (the client). This may be because of limited size of the UDP buffers on the client side. This is assuming that this is not a CPU issue, i.e. that the TCP stack performance is not much better that the UDP stack (and that TCP is not using more processors than UDP). If UDP buffers are the issue, then maybe TCP buffers need to be tuned. For example, see here and UDP Tuning here. One more thing that may help is to limit the number of UDP writes, by limiting the requested bandwidth. That may reduced the overhead of failed UDP packets writes and therefore increase performance. E.g. try |
Beta Was this translation helpful? Give feedback.
-
Context
Version of iperf3: 3.9
Hardware: x86_64
Operating system (and distribution, if any): Ubuntu 21.10
Kubernetes: 1.23
CNI: Calico, Cilium, Antrea
Bug Report
Expected Behavior
TCP Traffic has a throughput of around 25-30Gbit and multiple tests can be run simultaneously intra node while keeping this amount of throughput. I expect UDP traffic to have a throughput as high or higher than TCP traffic.
Actual Behavior
UDP throughput is around 10% of TCP throughput.
Steps to Reproduce
TCP behavior:
iperf3 -c 192.168.104.3 -b 0
UDP behavior:
iperf3 -c 192.168.104.3 -u -b 0
iperf3 -c 192.168.104.3 -u -b 0/50
iperf3 -c 192.168.104.3 -u -b 0 -l 50000
Are these results the expected behaviour or is there something I'm still missing?
Beta Was this translation helpful? Give feedback.
All reactions