当前位置: 首页 > news >正文

网络性能测试工具:iperf3介绍

文章目录

  • 前言
  • 一、iperf3 的安装和使用
    • 下载和安装
    • 参数说明
  • 二、iperf3 测试
    • 服务端启动
    • 客户端启动
    • 服务端输出
    • 反向测试
      • 客户端
      • 服务端


前言

新接触的网络环境如何评估网络带宽和吞吐量呢,有的项目没有对业务流量进行合理规划,服务或者中间件出口带宽经常有被打满的情况。所以提前预测网络带宽的瓶颈还是非常有必要的。

ipef3工具,是一个用于测试网络带宽的开源工具,用于评估网络的性能和吞吐量,他是iperf工具的第三个版本。


一、iperf3 的安装和使用

下载和安装

官网链接: https://iperf.fr/
iperf3支持Windows和Linux版本,Windows是直接编译好的exe文件,Linux一般是rpm包,可以通过yum源安装。
windows 下载连接: https://files.budman.pw/ 下载后解压,在cmd或者gitbash窗口可以启动。
Linux 通过 yum install iperf3 直接安装。

参数说明

  1. -c, --client <server_hostname>:指定客户端模式,连接到指定的服务器。

  2. -s, --server:指定服务器模式,启动 iPerf3 服务器。

  3. -p, --port :指定服务器监听的端口号,默认为 5201。

  4. -t, --time

  5. -i, --interval :设置报告输出的间隔时间,单位为秒,默认为 1 秒。

  6. -w, --window <window_size>:设置 TCP 窗口大小,单位为字节,默认为 128KB。

  7. -b, --bandwidth :限制带宽,单位为比特每秒(bps)。

  8. -u, --udp:使用 UDP 协议进行测试,默认TCP协议。

  9. -l, --len :设置 UDP 数据包的长度,单位为字节,默认为 1460 字节。

  10. -n, --bytes :设置要发送的字节数,可以与 -t 参数一起使用。

  11. -P, --parallel :指定并发连接数,可以同时进行多个连接。

  12. -R, --reverse:反向测试,客户端变为服务器,服务器变为客户端。

  13. -V, --IPv6:使用 IPv6 地址。

  14. -h, --help:显示帮助信息。

二、iperf3 测试

现在我们分别在Windows端和Linux端安装了iperf3软件。
Windows主机 (192.168.37.1) 客户端
Linux主机(192.168.37.100) 服务端

服务端启动

[root@work ~]# iperf3 -s -p 5222
-----------------------------------------------------------
Server listening on 5222
-----------------------------------------------------------

-s 表示服务器端 -p 指定服务端监听端口

客户端启动

$ ./iperf3.exe -c 192.168.37.100 -p 5222  -t 10 -i 1
Connecting to host 192.168.37.100, port 5222
[  4] local 192.168.37.1 port 13957 connected to 192.168.37.100 port 5222
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec   315 MBytes  2.64 Gbits/sec
[  4]   1.00-2.00   sec   349 MBytes  2.93 Gbits/sec
[  4]   2.00-3.00   sec   304 MBytes  2.55 Gbits/sec
[  4]   3.00-4.00   sec   332 MBytes  2.78 Gbits/sec
[  4]   4.00-5.00   sec   335 MBytes  2.81 Gbits/sec
[  4]   5.00-6.00   sec   352 MBytes  2.95 Gbits/sec
[  4]   6.00-7.00   sec   367 MBytes  3.07 Gbits/sec
[  4]   7.00-8.00   sec   367 MBytes  3.08 Gbits/sec
[  4]   8.00-9.00   sec   339 MBytes  2.84 Gbits/sec
[  4]   9.00-10.00  sec   318 MBytes  2.67 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec  3.30 GBytes  2.83 Gbits/sec                  sender
[  4]   0.00-10.00  sec  3.30 GBytes  2.83 Gbits/sec                  receiveriperf Done.

-c 表示客户端
-p 5222 指定服务端口
-t 10 测试持续时间
-i 1 设置报告输出的间隔时间。

服务端输出

[root@work ~]# iperf3 -s -p 5222
-----------------------------------------------------------
Server listening on 5222
-----------------------------------------------------------
Accepted connection from 192.168.37.1, port 13956
[  5] local 192.168.37.100 port 5222 connected to 192.168.37.1 port 13957
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec   301 MBytes  2.52 Gbits/sec                  
[  5]   1.00-2.00   sec   348 MBytes  2.92 Gbits/sec                  
[  5]   2.00-3.00   sec   304 MBytes  2.55 Gbits/sec                  
[  5]   3.00-4.00   sec   333 MBytes  2.79 Gbits/sec                  
[  5]   4.00-5.00   sec   338 MBytes  2.83 Gbits/sec                  
[  5]   5.00-6.00   sec   349 MBytes  2.93 Gbits/sec                  
[  5]   6.00-7.00   sec   366 MBytes  3.07 Gbits/sec                  
[  5]   7.00-8.00   sec   366 MBytes  3.07 Gbits/sec                  
[  5]   8.00-9.00   sec   344 MBytes  2.89 Gbits/sec                  
[  5]   9.00-10.00  sec   317 MBytes  2.66 Gbits/sec                  
[  5]  10.00-10.04  sec  11.4 MBytes  2.42 Gbits/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  3.30 GBytes  2.82 Gbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5222
-----------------------------------------------------------

结果查看,主要是看 receiver Bindwidth达到的的值。

反向测试

服务端启动方式不变,客户端在原来启动命令基础上,增加-R 参数就是客户端和服务器将对调过来。

客户端

$ ./iperf3.exe -c 192.168.37.100 -p 5222  -t 10 -i 1 -R
Connecting to host 192.168.37.100, port 5222
Reverse mode, remote host 192.168.37.100 is sending
[  4] local 192.168.37.1 port 9562 connected to 192.168.37.100 port 5222
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec   106 MBytes   892 Mbits/sec
[  4]   1.00-2.00   sec   106 MBytes   886 Mbits/sec
[  4]   2.00-3.00   sec   105 MBytes   877 Mbits/sec
[  4]   3.00-4.00   sec  97.9 MBytes   822 Mbits/sec
[  4]   4.00-5.00   sec  89.4 MBytes   750 Mbits/sec
[  4]   5.00-6.00   sec  74.6 MBytes   625 Mbits/sec
[  4]   6.00-7.00   sec  71.9 MBytes   603 Mbits/sec
[  4]   7.00-8.00   sec  68.0 MBytes   571 Mbits/sec
[  4]   8.00-9.00   sec  69.1 MBytes   580 Mbits/sec
[  4]   9.00-10.00  sec  69.4 MBytes   582 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   857 MBytes   719 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   857 MBytes   719 Mbits/sec                  receiveriperf Done.

服务端

[root@work ~]# iperf3 -s -p 5222
-----------------------------------------------------------
Server listening on 5222
-----------------------------------------------------------
Accepted connection from 192.168.37.1, port 9561
[  5] local 192.168.37.100 port 5222 connected to 192.168.37.1 port 9562
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  5]   0.00-1.02   sec   105 MBytes   863 Mbits/sec    0    218 KBytes       
[  5]   1.02-2.01   sec   105 MBytes   884 Mbits/sec    0    218 KBytes       
[  5]   2.01-3.01   sec   105 MBytes   878 Mbits/sec    0    218 KBytes       
[  5]   3.01-4.02   sec  98.2 MBytes   820 Mbits/sec    0    218 KBytes       
[  5]   4.02-5.02   sec  89.5 MBytes   753 Mbits/sec    0    218 KBytes       
[  5]   5.02-6.02   sec  75.0 MBytes   628 Mbits/sec    0    218 KBytes       
[  5]   6.02-7.03   sec  73.0 MBytes   603 Mbits/sec    0    218 KBytes       
[  5]   7.03-8.03   sec  67.5 MBytes   571 Mbits/sec    0    218 KBytes       
[  5]   8.03-9.03   sec  69.5 MBytes   579 Mbits/sec    0    218 KBytes       
[  5]   9.03-10.02  sec  68.8 MBytes   582 Mbits/sec    0    218 KBytes       
[  5]  10.02-10.04  sec  1.25 MBytes   562 Mbits/sec    0    218 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  5]   0.00-10.04  sec   857 MBytes   716 Mbits/sec    0             sender
[  5]   0.00-10.04  sec  0.00 Bytes  0.00 bits/sec                  receiver
-----------------------------------------------------------
Server listening on 5222
-----------------------------------------------------------

这里,服务端结果,看sender 这一行,这次服务端是发送端。带宽716Mbits/sec


相关文章:

  • 看图猜成语微信小程序源码
  • 利用预测大模型完成办公室饮水机剩余热水量
  • 视频汇聚管理安防监控平台EasyCVR程序报错“create jwtSecret del server class:0xf98b6040”的原因排查与解决
  • 【题解 | 分享】2023年十四届蓝桥杯国赛(Java B组)
  • 这里一定有你不知道的VS调试技巧
  • 【Java】刚刚!突然!紧急通知!垃圾回收!
  • 2024 rk
  • 记录【KVM更改br0网卡IP后,原来ip地址仍在问题】
  • 苍穹外卖数据可视化
  • js将dom转图片或文件
  • MySQL-事务日志
  • 轻兔推荐 —— 一个好用的软件服务推荐平台
  • 【算法】模拟算法——外观数组(medium)
  • 算法题day36(补5.22日卡)
  • 【摩托game】
  • 【MySQL经典案例分析】 Waiting for table metadata lock
  • 345-反转字符串中的元音字母
  • conda常用的命令
  • Docker: 容器互访的三种方式
  • ES6核心特性
  • httpie使用详解
  • k8s如何管理Pod
  • Objective-C 中关联引用的概念
  • PHP面试之三:MySQL数据库
  • python3 使用 asyncio 代替线程
  • 不发不行!Netty集成文字图片聊天室外加TCP/IP软硬件通信
  • 第三十一到第三十三天:我是精明的小卖家(一)
  • 对JS继承的一点思考
  • 对话 CTO〡听神策数据 CTO 曹犟描绘数据分析行业的无限可能
  • 分布式任务队列Celery
  • 搞机器学习要哪些技能
  • 使用docker-compose进行多节点部署
  • 一些css基础学习笔记
  • 找一份好的前端工作,起点很重要
  • 【运维趟坑回忆录】vpc迁移 - 吃螃蟹之路
  • puppet连载22:define用法
  • ​Linux Ubuntu环境下使用docker构建spark运行环境(超级详细)
  • # SpringBoot 如何让指定的Bean先加载
  • # 透过事物看本质的能力怎么培养?
  • $.type 怎么精确判断对象类型的 --(源码学习2)
  • (17)Hive ——MR任务的map与reduce个数由什么决定?
  • (NO.00004)iOS实现打砖块游戏(九):游戏中小球与反弹棒的碰撞
  • (poj1.3.2)1791(构造法模拟)
  • (八)光盘的挂载与解挂、挂载CentOS镜像、rpm安装软件详细学习笔记
  • (附源码)springboot电竞专题网站 毕业设计 641314
  • (转)EOS中账户、钱包和密钥的关系
  • (转)使用VMware vSphere标准交换机设置网络连接
  • **Java有哪些悲观锁的实现_乐观锁、悲观锁、Redis分布式锁和Zookeeper分布式锁的实现以及流程原理...
  • .gitignore文件_Git:.gitignore
  • .h头文件 .lib动态链接库文件 .dll 动态链接库
  • .NET C# 操作Neo4j图数据库
  • .NET Core 网络数据采集 -- 使用AngleSharp做html解析
  • .net php 通信,flash与asp/php/asp.net通信的方法
  • .NET/C# 使用 #if 和 Conditional 特性来按条件编译代码的不同原理和适用场景
  • .vue文件怎么使用_我在项目中是这样配置Vue的