我们在服务器上使用ConnectX-5100GbE以太网卡,通过mellanox交换机彼此连接。我们在我们的Kubernetes集群上使用了weavenet cni插件。当我们使用以下命令使用iperf工具进行一些测试时,主机中的连接速度将达到100 get。
# server host
host1 $ iperf -s -P8
# client host
host2 $ iperf -c -P8
Result: 98.8 Gbps transfer speed此外,当我们使用相同的工具和命令在同一主机上使用两个对接容器进行一些测试时,我们也会得到相同的结果。
# server host
host1$ docker run -it -p 5001:5001 ubuntu:latest-with-iperf iperf -s -P8
# client host
host2 $ docker run -it -p 5001:5001 ubuntu:latest-with-iperf iperf -c -P8
Result: 98.8 Gbps transfer speed但是,当我们在相同的主机(host1、host2)中使用相同的映像创建两个不同的部署,并通过服务ip(我们使用下面的yaml创建了一个k8s服务)进行相同的测试(它将流量重定向到服务器端时,就会得到唯一的<>2 2Gbps)。我们还使用pod的集群ip和服务的集群域进行了相同的测试,但是结果是相同的。
kubectl create deployment iperf-server --image=ubuntu:latest-with-iperf # after that we add affinity(host1) and container port sections to the yaml
kubectl create deployment iperf-client --image=ubuntu:latest-with-iperf # after that we add affinity(host2) and container port sections to the yamlkind: Service
apiVersion: v1
metadata:
name: iperf-server
namespace: default
spec:
ports:
- name: iperf
protocol: TCP
port: 5001
targetPort: 5001
selector:
name: iperf-server
clusterIP: 10.104.10.230
type: ClusterIP
sessionAffinity: None我们测试的场景:
我们需要达到100 get的吊舱间通讯速度。那么是什么导致了这个问题呢?
Update1:
hostNetwork: true键添加到部署中时,pods可以达到100 pods带宽。发布于 2022-11-27 13:27:53
我们通过禁用weavenet上的加密来解决这个问题。但是重新启动服务器就成功了。谢谢你的文章。
https://serverfault.com/questions/1116488
复制相似问题