Centos 64 bits

1.安装(2台服务器都要安装)

wget https://iperf.fr/download/fedora/iperf3-3.1.3-1.fc24.x86_64.rpm
rpm -i iperf3-3.1.3-1.fc24.x86_64.rpm
yum install -y iperf3

2.测速

在使用iperf3测试时,要同时在server端与client端都各执行一个程序,让它们互相传送报文进行测试
  • 1.首先在 22.23.5.66 机器启动server端的程序:

    iperf3 -s
    # 指定端口 -p 
    iperf3 -s -p 55510
  • 2.接着在 10.23.5.65 服务器上执行client 端的程序:(国内服务器拉国外落地加 -R)

    # 单线程
    iperf3 -c 210.3.157.191 -R
    # 4线程
    iperf3 -c 20.187.87.134 -R -P4
    # 指定端口 -p 
    iperf3 -c 210.129.15.90 -R -p 55510

Debian

apt-get install iperf3 -y

Ubuntu 64 bits / Debian 64 bits / Mint 64 bits (AMD64)

1.安装

sudo apt remove iperf3 libiperf0
sudo apt install libsctp1
wget https://iperf.fr/download/ubuntu/libiperf0_3.7-3_amd64.deb
wget https://iperf.fr/download/ubuntu/iperf3_3.7-3_amd64.deb
sudo dpkg -i libiperf0_3.7-3_amd64.deb iperf3_3.7-3_amd64.deb
  • 国内机器

    apt remove iperf3 libiperf0
    apt install libsctp1
    wget https://wikicc.cn/usr/uploads/libiperf0_3.7-3_amd64.deb
    wget https://wikicc.cn/usr/uploads/iperf3_3.7-3_amd64.deb
    dpkg -i libiperf0_3.7-3_amd64.deb iperf3_3.7-3_amd64.deb

2.使用

  • 使用方法和centos一样

3.删除

rm libiperf0_3.7-3_amd64.deb iperf3_3.7-3_amd64.deb

结果分析

  • 1.在测试时server端与client端都会出现测试的数据,client端以下是测试的结果:

    [jinguang1@localhost ~]$ iperf3 -c 10.23.5.66
    Connecting to host 10.23.5.66, port 5201
    [ 4] local 10.23.5.65 port 10412 connected to 22.23.5.66 port 5201
    [ ID] Interval Transfer Bandwidth Retr Cwnd
    [ 4] 0.00-1.00 sec 114 MBytes 953 Mbits/sec 0 95.5 KBytes
    [ 4] 1.00-2.00 sec 113 MBytes 948 Mbits/sec 0 95.5 KBytes
    [ 4] 2.00-3.00 sec 113 MBytes 950 Mbits/sec 0 95.5 KBytes
    [ 4] 3.00-4.00 sec 113 MBytes 948 Mbits/sec 0 95.5 KBytes
    [ 4] 4.00-5.00 sec 113 MBytes 950 Mbits/sec 0 95.5 KBytes
    [ 4] 5.00-6.00 sec 113 MBytes 948 Mbits/sec 0 95.5 KBytes
    [ 4] 6.00-7.00 sec 113 MBytes 948 Mbits/sec 0 95.5 KBytes
    [ 4] 7.00-8.00 sec 113 MBytes 950 Mbits/sec 0 95.5 KBytes
    [ 4] 8.00-9.00 sec 113 MBytes 948 Mbits/sec 0 95.5 KBytes
    [ 4] 9.00-10.00 sec 113 MBytes 950 Mbits/sec 0 95.5 KBytes
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval Transfer Bandwidth Retr
    [ 4] 0.00-10.00 sec 1.10 GBytes 949 Mbits/sec 0 sender
    [ 4] 0.00-10.00 sec 1.10 GBytes 949 Mbits/sec receiver

    从打印的内容看,缺省参数下,Client将连接Server端的5201端口,持续向Server端发送数据,并统计出每秒传输的字节数、带宽、出现报文重传的次数、拥塞窗口(Congestion Window)大小,整个测试将持续10秒钟;最后将汇总10秒的平均数据,并给出发送和接收端的统计。

  • 2.接下来分析一下Server的测试输出结果:

    [jinguang1@localhost ~]$ iperf3 -s
    warning: this system does not seem to support IPv6 - trying IPv4
    -----------------------------------------------------------
    Server listening on 5201
    -----------------------------------------------------------
    Accepted connection from 10.23.5.65, port 10410
    [ 5] local 10.23.5.66 port 5201 connected to 10.23.5.65 port 10412
    [ ID] Interval Transfer Bandwidth
    [ 5] 0.00-1.00 sec 109 MBytes 913 Mbits/sec
    [ 5] 1.00-2.00 sec 113 MBytes 948 Mbits/sec
    [ 5] 2.00-3.00 sec 113 MBytes 949 Mbits/sec
    [ 5] 3.00-4.00 sec 113 MBytes 949 Mbits/sec
    [ 5] 4.00-5.00 sec 113 MBytes 949 Mbits/sec
    [ 5] 5.00-6.00 sec 113 MBytes 949 Mbits/sec
    [ 5] 6.00-7.00 sec 113 MBytes 949 Mbits/sec
    [ 5] 7.00-8.00 sec 113 MBytes 949 Mbits/sec
    [ 5] 8.00-9.00 sec 113 MBytes 949 Mbits/sec
    [ 5] 9.00-10.00 sec 113 MBytes 949 Mbits/sec
    [ 5] 10.00-10.04 sec 4.29 MBytes 947 Mbits/sec
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval Transfer Bandwidth
    [ 5] 0.00-10.04 sec 0.00 Bytes 0.00 bits/sec sender
    [ 5] 0.00-10.04 sec 1.10 GBytes 945 Mbits/sec receiver
    -----------------------------------------------------------
    Server listening on 5201

    erver端缺省监听IPv6地址和端口,如果未配置IPv6,会尝试IPv4。日志显示接收了来自10.23.5.65,源端口未10410的测试请求。Client端连续进行了10秒的测试,并显示了每秒传输的字节数,带宽信息;测试结束后会汇总发送和接收的统计信息。在Client连接关闭之后会继续侦听5201端口。

附件:iperf3.zip

原文地址:http://www.mamicode.com/info-detail-2877832.html
原文地址:https://blog.51cto.com/u_13613726/2460671


疑难杂症

  • 提示 “ You might want to run apt-get --fix-broken install' to correct these:

    apt-get --fix-broken install
最后修改:2022 年 12 月 02 日
如果觉得我的文章对你有用,请随意赞赏