首页 > 其他分享 >iperf3在OpenShift 4上的网络测试

iperf3在OpenShift 4上的网络测试

时间:2023-06-09 15:25:11浏览次数:31  
标签:MBytes iperf3 Gbits port sec 测试 GBytes OpenShift 10.00

有账号的同学可以去访问一下这个

https://access.redhat.com/articles/5233541

话不多说先构建一个iperf3的镜像,话说在rhel下真是麻烦,repolist一个没有,然后直接切换到fedora了搞定了。

[lab-user@bastion ~]$ cat Dockerfile 
FROM fedora
RUN yum update -y
RUN yum install -y iperf3
ENTRYPOINT trap : TERM INT; sleep infinity & wait # Listen for kill signals and exit quickly.
$ podman build -t quay.io/jnie/iperf .
$ podman push quay.io/jnie/iperf

对了还需要先登录一下
podman login -u="jnie" -p="8TIlF4K0Zjo2ds1fHHU+Bn9q+YLVy1404EXmdUa1c+wDz4yjZ/cJ6xxxxxxx/tt" quay.io

 

Pod与Pod间的带宽测试

部署两个Pod然后进行测试

oc adm policy add-scc-to-user -z default privileged

 

oc label --overwrite ns myproject \
  pod-security.kubernetes.io/enforce=baseline \
  pod-security.kubernetes.io/enforce-version=v1.24
[lab-user@bastion ~]$ cat iperf1.yaml
apiVersion: v1
kind: Pod
metadata:
  name: iperf-server
  labels:
    role: server
spec:
  containers:
  - name: server
    image: quay.io/jnie/iperf
---
apiVersion: v1
kind: Pod
metadata:
  name: iperf-client
spec:
  affinity:
    podAntiAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: role
            operator: In
            values:
            - server
        topologyKey: kubernetes.io/hostname
  containers:
  - name: client
    image: quay.io/jnie/iperf

 

[lab-user@bastion ~]$ oc get pods -o wide
NAME           READY   STATUS    RESTARTS   AGE   IP            NODE                                         NOMINATED NODE   READINESS GATES
iperf-client   1/1     Running   0          15s   10.130.0.25   ip-10-0-162-179.us-east-2.compute.internal   <none>           <none>
iperf-server   1/1     Running   0          15s   10.131.0.35   ip-10-0-139-112.us-east-2.compute.internal   <none>           <none>

 

[lab-user@bastion ~]$ oc exec -it iperf-server -- iperf3 -i 5 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 10.130.0.25, port 35024
[  5] local 10.131.0.35 port 5201 connected to 10.130.0.25 port 35040
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-5.00   sec  2.42 GBytes  4.16 Gbits/sec                  
[  5]   5.00-10.01  sec  2.44 GBytes  4.19 Gbits/sec                  
[  5]  10.01-15.01  sec  2.49 GBytes  4.28 Gbits/sec                  
[  5]  15.01-20.01  sec  2.51 GBytes  4.32 Gbits/sec                  
[  5]  20.01-25.01  sec  2.51 GBytes  4.32 Gbits/sec                  
[  5]  25.01-30.01  sec  2.53 GBytes  4.35 Gbits/sec                  
[  5]  30.01-35.01  sec  2.53 GBytes  4.35 Gbits/sec                  
[  5]  35.01-40.01  sec  2.55 GBytes  4.38 Gbits/sec                  
[  5]  40.01-45.01  sec  2.52 GBytes  4.32 Gbits/sec                  
[  5]  45.01-50.01  sec  2.51 GBytes  4.31 Gbits/sec                  
[  5]  50.01-55.01  sec  2.52 GBytes  4.34 Gbits/sec                  
[  5]  55.01-60.01  sec  2.54 GBytes  4.36 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-60.01  sec  30.1 GBytes  4.31 Gbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201 (test #2)
-----------------------------------------------------------


[lab-user@bastion ~]$ oc exec -it iperf-client -- iperf3 -i 5 -t 60 -c 10.131.0.35
Connecting to host 10.131.0.35, port 5201
[  5] local 10.130.0.25 port 35040 connected to 10.131.0.35 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-5.00   sec  2.42 GBytes  4.16 Gbits/sec   59   1.06 MBytes       
[  5]   5.00-10.00  sec  2.44 GBytes  4.20 Gbits/sec    0   1.51 MBytes       
[  5]  10.00-15.00  sec  2.49 GBytes  4.28 Gbits/sec    9   3.05 MBytes       
[  5]  15.00-20.00  sec  2.51 GBytes  4.32 Gbits/sec   19   3.05 MBytes       
[  5]  20.00-25.00  sec  2.51 GBytes  4.32 Gbits/sec   19   3.05 MBytes       
[  5]  25.00-30.00  sec  2.53 GBytes  4.35 Gbits/sec   12   3.05 MBytes       
[  5]  30.00-35.00  sec  2.53 GBytes  4.35 Gbits/sec   25   3.05 MBytes       
[  5]  35.00-40.00  sec  2.55 GBytes  4.38 Gbits/sec   16   3.05 MBytes       
[  5]  40.00-45.00  sec  2.52 GBytes  4.32 Gbits/sec   27   3.05 MBytes       
[  5]  45.00-50.00  sec  2.51 GBytes  4.31 Gbits/sec   23   3.05 MBytes       
[  5]  50.00-55.00  sec  2.52 GBytes  4.34 Gbits/sec   17   3.05 MBytes       
[  5]  55.00-60.00  sec  2.54 GBytes  4.36 Gbits/sec   15   3.05 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-60.00  sec  30.1 GBytes  4.31 Gbits/sec  241             sender
[  5]   0.00-60.01  sec  30.1 GBytes  4.31 Gbits/sec                  receiver

iperf Done.

换个参数,P=4

[lab-user@bastion ~]$ oc exec -it iperf-client -- iperf3 -i 5 -t 60 -c 10.131.0.35 -f Mbits -P 4
Connecting to host 10.131.0.35, port 5201
[  5] local 10.130.0.25 port 51318 connected to 10.131.0.35 port 5201
[  7] local 10.130.0.25 port 51328 connected to 10.131.0.35 port 5201
[  9] local 10.130.0.25 port 51342 connected to 10.131.0.35 port 5201
[ 11] local 10.130.0.25 port 51346 connected to 10.131.0.35 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-5.00   sec   841 MBytes   168 MBytes/sec    5    838 KBytes       
[  7]   0.00-5.00   sec   819 MBytes   164 MBytes/sec   39    717 KBytes       
[  9]   0.00-5.00   sec   831 MBytes   166 MBytes/sec   39    916 KBytes       
[ 11]   0.00-5.00   sec  2.28 GBytes   468 MBytes/sec  125   1002 KBytes       
[SUM]   0.00-5.00   sec  4.72 GBytes   966 MBytes/sec  208             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   5.00-10.00  sec   848 MBytes   169 MBytes/sec   40   1.34 MBytes       
[  7]   5.00-10.00  sec   822 MBytes   164 MBytes/sec   46    951 KBytes       
[  9]   5.00-10.00  sec   831 MBytes   166 MBytes/sec    6   1.14 MBytes       
[ 11]   5.00-10.00  sec  2.25 GBytes   460 MBytes/sec   70    951 KBytes       
[SUM]   5.00-10.00  sec  4.69 GBytes   960 MBytes/sec  162             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]  10.00-15.00  sec   834 MBytes   167 MBytes/sec   23   1.16 MBytes       
[  7]  10.00-15.00  sec   823 MBytes   165 MBytes/sec   21   1.16 MBytes       
[  9]  10.00-15.00  sec   842 MBytes   169 MBytes/sec   23   1.87 MBytes       
[ 11]  10.00-15.00  sec  2.27 GBytes   464 MBytes/sec   21   1.24 MBytes       
[SUM]  10.00-15.00  sec  4.71 GBytes   964 MBytes/sec   88             



==============Server===============
Server listening on 5201 (test #2)
-----------------------------------------------------------
Accepted connection from 10.130.0.25, port 51308
[  5] local 10.131.0.35 port 5201 connected to 10.130.0.25 port 51318
[  8] local 10.131.0.35 port 5201 connected to 10.130.0.25 port 51328
[ 10] local 10.131.0.35 port 5201 connected to 10.130.0.25 port 51342
[ 12] local 10.131.0.35 port 5201 connected to 10.130.0.25 port 51346
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-5.00   sec   838 MBytes  1.41 Gbits/sec                  
[  8]   0.00-5.00   sec   816 MBytes  1.37 Gbits/sec                  
[ 10]   0.00-5.00   sec   828 MBytes  1.39 Gbits/sec                  
[ 12]   0.00-5.00   sec  2.28 GBytes  3.92 Gbits/sec                  
[SUM]   0.00-5.00   sec  4.70 GBytes  8.08 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   5.00-10.00  sec   846 MBytes  1.42 Gbits/sec                  
[  8]   5.00-10.00  sec   821 MBytes  1.38 Gbits/sec                  
[ 10]   5.00-10.00  sec   830 MBytes  1.39 Gbits/sec                  
[ 12]   5.00-10.00  sec  2.25 GBytes  3.86 Gbits/sec                  
[SUM]   5.00-10.00  sec  4.68 GBytes  8.05 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]  10.00-15.00  sec   834 MBytes  1.40 Gbits/sec                  
[  8]  10.00-15.00  sec   823 MBytes  1.38 Gbits/sec                  
[ 10]  10.00-15.00  sec   843 MBytes  1.41 Gbits/sec                  
[ 12]  10.00-15.00  sec  2.26 GBytes  3.89 Gbits/sec                  
[SUM]  10.00-15.00  sec  4.71 GBytes  8.08 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]  10.00-15.00  sec   834 MBytes  1.40 Gbits/sec                  
[  8]  10.00-15.00  sec   823 MBytes  1.38 Gbits/sec    
[ 10]  10.00-15.00  sec   843 MBytes  1.41 Gbits/sec                  
[ 12]  10.00-15.00  sec  2.26 GBytes  3.89 Gbits/sec                  
[SUM]  10.00-15.00  sec  4.71 GBytes  8.08 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-15.00  sec  3.05 GBytes  1.75 Gbits/sec                  receiver
[  8]   0.00-15.00  sec  2.99 GBytes  1.71 Gbits/sec                  receiver
[ 10]   0.00-15.00  sec  3.05 GBytes  1.75 Gbits/sec                  receiver
[ 12]   0.00-15.00  sec  8.43 GBytes  4.83 Gbits/sec                  receiver
[SUM]   0.00-15.00  sec  17.5 GBytes  10.0 Gbits/sec                  receiver
iperf3: the client has terminated

 

Node与Node之间的带宽测试

节点与节点之前的通讯,因为是rhcos,所以创建两个pod, 然后通过hostnetwork测试

 

oc label --overwrite ns myproject \
  pod-security.kubernetes.io/enforce=privileged \
  pod-security.kubernetes.io/enforce-version=v1.24
oc adm policy add-scc-to-user -z default privileged
oc adm policy add-scc-to-user hostnetwork -z default
[lab-user@bastion ~]$ cat iperf-hostnetwork.yaml 
apiVersion: v1
kind: Pod
metadata:
  name: iperf-server
  labels:
    role: server
spec:
  hostNetwork: true
  containers:
  - name: server
    image: quay.io/jnie/iperf
---
apiVersion: v1
kind: Pod
metadata:
  name: iperf-client
spec:
  hostNetwork: true
  affinity:
    podAntiAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: role
            operator: In
            values:
            - server
        topologyKey: kubernetes.io/hostname
  containers:
  - name: client
    image: quay.io/jnie/iperf
[lab-user@bastion ~]$ oc create -f iperf-hostnetwork.yaml
pod/iperf-server created
pod/iperf-client created
[lab-user@bastion ~]$ oc get pods -o wide
NAME           READY   STATUS    RESTARTS   AGE   IP             NODE                                         NOMINATED NODE   READINESS GATES
iperf-client   1/1     Running   0          19s   10.0.162.179   ip-10-0-162-179.us-east-2.compute.internal   <none>           <none>
iperf-server   1/1     Running   0          19s   10.0.139.112   ip-10-0-139-112.us-east-2.compute.internal   <none>           <none>

测试的时候因为5201端口问题,没有联通。

 

标签:MBytes,iperf3,Gbits,port,sec,测试,GBytes,OpenShift,10.00
From: https://www.cnblogs.com/ericnie/p/17469299.html

相关文章

  • 5年测试经验怎么着我也能要个20K吧?没想到被阿里P8问傻了
    都说金三银四是跳槽涨薪季,我也是着急忙慌的准备简历——5年软件测试经验,可独立测试大型产品项目,熟悉项目测试流程…薪资要求?5年测试经验起码能要个20K吧?我加班肝了一页半简历,投出去一周,面试电话倒是不少,自信满满去面试,现场被问了这么几个问题———“会代码吗?”“额…会一......
  • 车载网络OTA 升级测试要点
    车载网络OTA(Over-the-Air)升级是一种通过互联网对车辆的软件和系统进行远程升级的技术。OTA升级一般分为全量包升级和差分包升级。以下是车载网络OTA升级测试的详细介绍:1.升级准备确定车辆的软件版本和当前的系统状态。确保车辆与互联网的连接稳定,并具备进行OTA升级的硬件和软件......
  • 车载雷达报警测试要点
    车载雷达报警测试是指对车辆上安装的雷达系统进行报警功能的测试。以下是车载雷达报警测试的详细介绍:1.测试准备准备一个测试车辆,并确保雷达系统已正确安装和连接。确认雷达系统与车辆的其他系统(如车载显示屏、音响系统)之间的通信和集成正常。2.报警触发测试测试雷达系统的报......
  • Vulnhub之Connect The Dots靶机详细测试过程
    ConnectTheDots识别目标主机IP地址(kali㉿kali)-[~/Desktop/Vulnhub/Connect_the_dots]└─$sudonetdiscover-ieth1-r192.168.56.0/24Currentlyscanning:192.168.56.0/24|ScreenView:UniqueHosts......
  • 性能测试-第01天-从理解到体验,最后能够对比说出Loadrunner和JMeter的优缺点
    更多功能测试以及全套学习路线图均在专栏,↑↑戳进去领取~系列文章目录......
  • 验签失败!单元测试成功!!究竟是啥坑?
    错误的入参:rawData===>  "{\"nickName\":\"拥有你便是拥有一切\",\"gender\":1,\"language\":\"zh_CN\",\"city\":\"Zhangjiakou\",\"province\":\"Hebei\",\&qu......
  • 谷歌公开自家「AI+软件工程」框架DIDACT:数千名开发者内部测试,用了都说生产力高
    谷歌公开自家「AI+软件工程」框架DIDACT:数千名开发者内部测试,用了都说生产力高摘要谷歌近日公布了自家的DIDACT(DynamicIntegratedDeveloperACTivity,动态集成开发人员活动)框架,用AI技术增强软件工程,将软件开发的中间状态作为训练数据,辅助开发人员编写、修改代码,并实时了解软件......
  • 软件工程|软件测试
    这是GIS开发课的测试部分的知识,看了一下PPT,基本和软工的测试部分是差不多的,这里就放在一起了。测试的基本概念软件测试是保证软件质量,提高软件可靠性的关键。软件测试的目的:发现错误测试与调试比较测试(test)调试(debug)在未知错误的情况下,检查程序代码是否有问......
  • 压力测试分为稳定性测试和破坏性测试
    压力测试分为稳定性测试和破坏性测试压力测试是一种对软件系统进行负载测试的常见手段,可以评估其在不同负载条件下的稳定性、性能和可靠性等指标。常见的压力测试分为两种类型:稳定性测试和破坏性测试。1.稳定性测试稳定性测试也称为基准测试,它主要关注软件系统在......
  • 接口测试测试点__肖sir__测试点整理
    接口测试测试点==============================================================================================================================================================================================================================================......