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

Ubuntu系统下交叉编译iperf3

一、参考资料

Linux下iperf3移植到arm下测试100M网口-CSDN博客

Iperf3移植到ARM Linux及使用教程-CSDN博客

二、准备工作

1. 编译环境

  • 宿主机:Ubuntu 20.04.6 LTS
  • Host:ARM32位
  • 交叉编译器:arm-linux-gnueabihf-gcc-11.1.0

2. 设置交叉编译工具链

在交叉编译之前,需要设置交叉编译工具链的环境变量。

export PATH=/path/to/toolchains/arm-linux-gnueabihf/bin:$PATH

3. apt安装mosquitto

在宿主机中直接安装iperf3。

sudo apt-get install iperf3  # iperf3(推荐)
sudo apt-get install iperf   # iperf2

三、交叉编译iperf3

1. 下载源码

下载 iperf:https://downloads.es.net/pub/iperf/

下载并解压源码。

tar -xvzf iperf-3.18.tar.gz
cd iperf-3.18
mkdir arm32_install

2. 生成 configure 配置

./configure \--prefix=/path/to/iperf-3.18/arm32_install \--with-sysroot=/path/to/toolchains/arm-linux-gnueabihf/arm-linux-gnueabihf/libc \--host=arm-linux-gnueabihf \--enable-shared \--enable-static 

输出示例:

yoyo@yoyo:~/360Downloads/iperf-3.18$ ./configure \
> --prefix=/path/to/iperf-3.18/arm32_install \
> --with-sysroot=/path/to/toolchains/arm-linux-gnueabihf/arm-linux-gnueabihf/libc \
> --host=arm-linux-gnueabihf \
> --enable-shared \
> --enable-static
checking for a BSD-compatible install... /usr/bin/install -c
checking whether sleep supports fractional seconds... yes
checking filesystem timestamp resolution... 0.01
checking whether build environment is sane... yes
checking for arm-linux-gnueabihf-strip... arm-linux-gnueabihf-strip
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking xargs -n works... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-gnueabihf
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for arm-linux-gnueabihf-gcc... arm-linux-gnueabihf-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether arm-linux-gnueabihf-gcc accepts -g... yes
checking for arm-linux-gnueabihf-gcc option to enable C11 features... none needed
checking whether arm-linux-gnueabihf-gcc understands -c and -o together... yes
checking dependency style of arm-linux-gnueabihf-gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by arm-linux-gnueabihf-gcc... /path/to/toolchains/arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ld
checking if the linker (/path/to/toolchains/arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /path/to/toolchains/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-nm -B
checking the name lister (/path/to/toolchains/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to arm-unknown-linux-gnueabihf format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /path/to/toolchains/arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ld option to reload object files... -r
checking for file... file
checking for arm-linux-gnueabihf-objdump... arm-linux-gnueabihf-objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-gnueabihf-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-gnueabihf-ranlib... arm-linux-gnueabihf-ranlib
checking for arm-linux-gnueabihf-ar... arm-linux-gnueabihf-ar
checking for archiver @FILE support... @
checking for arm-linux-gnueabihf-strip... (cached) arm-linux-gnueabihf-strip
checking command to parse /path/to/toolchains/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-nm -B output from arm-linux-gnueabihf-gcc object... ok
checking for sysroot... /path/to/toolchains/arm-linux-gnueabihf/arm-linux-gnueabihf/libc
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for arm-linux-gnueabihf-mt... no
checking for mt... mt
configure: WARNING: using cross tools not prefixed with host triplet
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-linux-gnueabihf-gcc supports -fno-rtti -fno-exceptions... no
checking for arm-linux-gnueabihf-gcc option to produce PIC... -fPIC -DPIC
checking if arm-linux-gnueabihf-gcc PIC flag -fPIC -DPIC works... yes
checking if arm-linux-gnueabihf-gcc static flag -static works... yes
checking if arm-linux-gnueabihf-gcc supports -c -o file.o... yes
checking if arm-linux-gnueabihf-gcc supports -c -o file.o... (cached) yes
checking whether the arm-linux-gnueabihf-gcc linker (/path/to/toolchains/arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for arm-linux-gnueabihf-gcc... (cached) arm-linux-gnueabihf-gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether arm-linux-gnueabihf-gcc accepts -g... (cached) yes
checking for arm-linux-gnueabihf-gcc option to enable C11 features... (cached) none needed
checking whether arm-linux-gnueabihf-gcc understands -c and -o together... (cached) yes
checking dependency style of arm-linux-gnueabihf-gcc... (cached) gcc3
checking whether ln -s works... yes
checking for library containing floor... -lm
checking for library containing socket... none required
checking for library containing inet_ntop... none required
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... arm-linux-gnueabihf-gcc -E
checking for egrep -e... (cached) /usr/bin/grep -E
checking whether arm-linux-gnueabihf-gcc is Clang... no
checking whether pthreads work with "-pthread" and "-lpthread"... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for stdatomic.h... yes
checking whether libatomic is required... no
checking for poll.h... yes
checking for linux/tcp.h... yes
checking for sys/socket.h... yes
checking for netinet/sctp.h... no
checking for endian.h... yes
checking for arm-linux-gnueabihf-pkg-config... no
checking for pkg-config... pkg-config
checking for include/openssl/ssl.h in /usr/local/ssl... no
checking for include/openssl/ssl.h in /usr/lib/ssl... no
checking for include/openssl/ssl.h in /usr/ssl... no
checking for include/openssl/ssl.h in /usr/pkg... no
checking for include/openssl/ssl.h in /usr/local... no
checking for include/openssl/ssl.h in /usr... no
checking whether compiling and linking against OpenSSL works... no
checking TCP_CONGESTION socket option... yes
checking TCP_USER_TIMEOUT socket option... yes
checking IPv6 flowlabel support... yes
checking for cpuset_setaffinity... no
checking for sched_setaffinity... yes
checking for SetProcessAffinityMask... no
checking for daemon... yes
checking for sendfile... yes
checking for getline... yes
checking SO_MAX_PACING_RATE socket option... yes
checking SO_BINDTODEVICE socket option... yes
checking IP_MTU_DISCOVER socket option... yes
checking IP_DONTFRAG socket option... no
checking IP_DONTFRAGMENT socket option... no
checking any kind of DF socket option... yes
checking for struct tcp_info.tcpi_snd_wnd... no
checking for library containing clock_gettime... none required
checking for clock_gettime... yes
checking for library containing nanosleep... none required
checking for nanosleep... yes
checking for library containing clock_nanosleep... none required
checking for clock_nanosleep... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/version.h
config.status: creating examples/Makefile
config.status: creating iperf3.spec
config.status: creating src/iperf_config.h
config.status: executing depfiles commands
config.status: executing libtool commands

3. 编译安装

make -j8
make install

make 编译:

yoyo@yoyo:~/360Downloads/iperf-3.18$ make -j8
Making all in src
make[1]: Entering directory '/path/to/iperf-3.18/src'
make  all-am
make[2]: Entering directory '/path/to/iperf-3.18/src'CC       iperf3-main.oCC       cjson.loCC       iperf_api.loCC       iperf_error.loCC       iperf_auth.loCC       iperf_locale.loCC       iperf_client_api.loCC       iperf_server_api.loCC       iperf_tcp.loCC       iperf_udp.loCC       iperf_sctp.loCC       iperf_util.loCC       iperf_time.loCC       iperf_pthread.loCC       dscp.loCC       net.loCC       tcp_info.loCC       timer.loCC       units.loCC       t_timer-t_timer.oCC       t_units-t_units.oCC       t_uuid-t_uuid.oCC       t_api-t_api.oCC       t_auth-t_auth.oCCLD     libiperf.laCCLD     t_timerCCLD     iperf3CCLD     t_uuidCCLD     t_unitsCCLD     t_apiCCLD     t_auth
make[2]: Leaving directory '/path/to/iperf-3.18/src'
make[1]: Leaving directory '/path/to/iperf-3.18/src'
Making all in examples
make[1]: Entering directory '/path/to/iperf-3.18/examples'CC       mic-mic.oCC       mis-mis.oCCLD     misCCLD     mic
make[1]: Leaving directory '/path/to/iperf-3.18/examples'
make[1]: Entering directory '/path/to/iperf-3.18'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/path/to/iperf-3.18'

make install 安装:

yoyo@yoyo:~/360Downloads/iperf-3.18$ make install
Making install in src
make[1]: Entering directory '/path/to/iperf-3.18/src'
make[2]: Entering directory '/path/to/iperf-3.18/src'/usr/bin/mkdir -p '/path/to/iperf-3.18/arm32_install/lib'/bin/bash ../libtool   --mode=install /usr/bin/install -c   libiperf.la '/path/to/iperf-3.18/arm32_install/lib'
libtool: install: /usr/bin/install -c .libs/libiperf.so.0.0.0 /path/to/iperf-3.18/arm32_install/lib/libiperf.so.0.0.0
libtool: install: (cd /path/to/iperf-3.18/arm32_install/lib && { ln -s -f libiperf.so.0.0.0 libiperf.so.0 || { rm -f libiperf.so.0 && ln -s libiperf.so.0.0.0 libiperf.so.0; }; })
libtool: install: (cd /path/to/iperf-3.18/arm32_install/lib && { ln -s -f libiperf.so.0.0.0 libiperf.so || { rm -f libiperf.so && ln -s libiperf.so.0.0.0 libiperf.so; }; })
libtool: install: /usr/bin/install -c .libs/libiperf.lai /path/to/iperf-3.18/arm32_install/lib/libiperf.la
libtool: install: /usr/bin/install -c .libs/libiperf.a /path/to/iperf-3.18/arm32_install/lib/libiperf.a
libtool: install: chmod 644 /path/to/iperf-3.18/arm32_install/lib/libiperf.a
libtool: install: arm-linux-gnueabihf-ranlib /path/to/iperf-3.18/arm32_install/lib/libiperf.a
libtool: finish: PATH="/path/to/toolchains/arm-linux-gnueabihf/bin:/path/to/cmake-3.31.3-linux-x86_64/bin:/home/yoyo/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /path/to/iperf-3.18/arm32_install/lib
----------------------------------------------------------------------
Libraries have been installed in:/path/to/iperf-3.18/arm32_install/libIf you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:- add LIBDIR to the 'LD_LIBRARY_PATH' environment variableduring execution- add LIBDIR to the 'LD_RUN_PATH' environment variableduring linking- use the '-Wl,-rpath -Wl,LIBDIR' linker flag- have your system administrator add LIBDIR to '/etc/ld.so.conf'See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------/usr/bin/mkdir -p '/path/to/iperf-3.18/arm32_install/bin'/bin/bash ../libtool   --mode=install /usr/bin/install -c iperf3 '/path/to/iperf-3.18/arm32_install/bin'
libtool: install: /usr/bin/install -c .libs/iperf3 /path/to/iperf-3.18/arm32_install/bin/iperf3/usr/bin/mkdir -p '/path/to/iperf-3.18/arm32_install/include'/usr/bin/install -c -m 644 iperf_api.h '/path/to/iperf-3.18/arm32_install/include'/usr/bin/mkdir -p '/path/to/iperf-3.18/arm32_install/share/man/man1'/usr/bin/install -c -m 644 iperf3.1 '/path/to/iperf-3.18/arm32_install/share/man/man1'/usr/bin/mkdir -p '/path/to/iperf-3.18/arm32_install/share/man/man3'/usr/bin/install -c -m 644 libiperf.3 '/path/to/iperf-3.18/arm32_install/share/man/man3'
make[2]: Leaving directory '/path/to/iperf-3.18/src'
make[1]: Leaving directory '/path/to/iperf-3.18/src'
Making install in examples
make[1]: Entering directory '/path/to/iperf-3.18/examples'
make[2]: Entering directory '/path/to/iperf-3.18/examples'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/path/to/iperf-3.18/examples'
make[1]: Leaving directory '/path/to/iperf-3.18/examples'
make[1]: Entering directory '/path/to/iperf-3.18'
make[2]: Entering directory '/path/to/iperf-3.18'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/path/to/iperf-3.18'
make[1]: Leaving directory '/path/to/iperf-3.18'

4. 去除调试信息并压缩

使用交叉编译工具 strip 去除镜像的调试信息,在不影响使程序使用的情况下,程序大小一般可以减小50%左右。

cd arm32_install
arm-linux-gnueabihf-strip bin/iperf3              # 去除iperf3镜像调试信息
arm-linux-gnueabihf-strip lib/libiperf.so.0.0.0   # 去除共享库的调试信息
rm lib/libiperf.a lib/libiperf.la                    # 删除两个不用的库文件
tar -jcvf iperf-3.18.tar.bz2 bin lib                  # 压缩bin和lib目录

5. 移植到开发板

将打包后的 iperf-3.18.tar.bz2 压缩包通过U盘、FTP或者NFS等方式拷贝到目标板,并分别解压到 /bin/sbin 目录。

cp iperf-3.18.tar.bz2 ~                  # 将复制压缩包到目标板用户目录
tar -jxvf iperf-3.18.tar.bz2 bin -C /usr   # 解压镜像到/usr/bin
tar -jxvf iperf-3.18.tar.bz2 lib -C /usr   # 解压库文件到/usr/lib

三、快速体验iperf3

一文搞懂iperf:网络性能测试的秘密武器

1. 启动iperf3服务端

由于iperf3工具基于客户端(client)和服务器(server)的工作模式,在测试之前应启动iperf3服务端。

参数说明示例
-s以服务端模式运行iperf3 -s
-p <端口>指定监听端口(默认 5201)iperf3 -s -p 6000
-D以守护进程(后台)模式运行iperf3 -s -D
-B <IP>绑定到特定网络接口的 IPiperf3 -s -B 192.168.1.100
-i <秒>输出报告间隔时间iperf3 -s -i 5
-L <日志文件>记录日志到指定文件iperf3 -s -L server.log
-1单次测试后自动退出iperf3 -s -1
--json输出 JSON 格式结果(iperf3)iperf3 -s --json
-u强制使用 UDP 协议(需与客户端配合)iperf3 -s -u
-6启用 IPv6 监听iperf3 -s -6
-V启用兼容模式(iperf2 兼容)iperf3 -s -V
-K启用 TCP 快速打开(Fast Open)iperf3 -s -K

2. 启动iperf3客户端(TCP模式)

使用 iperf3 -c 命令来启动iperf3客户端,并链接到服务器。

基础参数

参数说明
-c <服务器IP>必填,指定 iperf3 服务端 IP 地址(如 -c 192.168.1.100)。
-p <端口>指定服务端监听的端口(默认 5201)。
-t <秒>测试持续时间(默认 10 秒,建议长时间测试用 -t 60)。
-w <窗口大小>设置 TCP 窗口大小(如 -w 1M 表示 1MB,需结合网络延迟优化)。
-P <并发数>创建多个 并行 TCP 连接(如 -P 4,但 iperf3 需多实例模拟多线程)。
-R反向模式(服务端发送数据,客户端接收,用于测试上行/下行带宽)。
-O <秒>设置 warmup 时间(跳过前 N 秒的数据统计,如 -O 2 忽略前 2 秒)。
-J / --json输出 JSON 格式 结果(便于脚本解析)。
--logfile <文件>将结果输出到日志文件(如 --logfile result.txt)。
-B <本地IP>绑定客户端到指定本地 IP 或网卡(多网卡环境专用)。

高级调优参数

参数说明
-M <MSS>设置 TCP 最大报文段大小(默认根据 MTU 自动计算)。
-N禁用 Nagle 算法(减少小包延迟,适合低延迟场景)。
-Z / --zerocopy启用零拷贝模式(减少 CPU 占用,需内核支持)。
-C <拥塞控制算法>指定 TCP 拥塞控制算法(如 -C cubic-C bbr)。

2.1 基础测试(默认参数)

测试 10 秒的 TCP 带宽,使用默认窗口大小。

iperf3 -c 192.168.33.1

客户端输出示例:

yoyo@yoyo:~/360Downloads/iperf-3.18$ iperf3 -c 192.168.33.1
Connecting to host 192.168.33.1, port 5201
[  5] local 192.168.33.32 port 44558 connected to 192.168.33.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  7.39 MBytes  61.9 Mbits/sec    0    165 KBytes       
[  5]   1.00-2.00   sec  6.90 MBytes  57.9 Mbits/sec    0    165 KBytes       
[  5]   2.00-3.00   sec  6.77 MBytes  56.8 Mbits/sec    0    165 KBytes       
[  5]   3.00-4.00   sec  7.21 MBytes  60.5 Mbits/sec    0    165 KBytes       
[  5]   4.00-5.00   sec  6.96 MBytes  58.3 Mbits/sec    0    165 KBytes       
[  5]   5.00-6.00   sec  6.96 MBytes  58.4 Mbits/sec    0    165 KBytes       
[  5]   6.00-7.00   sec  7.02 MBytes  58.9 Mbits/sec    0    165 KBytes       
[  5]   7.00-8.00   sec  7.08 MBytes  59.4 Mbits/sec    0    165 KBytes       
[  5]   8.00-9.00   sec  7.15 MBytes  59.9 Mbits/sec    0    165 KBytes       
[  5]   9.00-10.00  sec  6.90 MBytes  57.8 Mbits/sec    0    165 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  70.3 MBytes  59.0 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  69.8 MBytes  58.6 Mbits/sec                  receiveriperf Done.

服务端输出示例:

Accepted connection from 192.168.33.32, port 44546
[  5] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 44558
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec  6.45 MBytes  54.1 Mbits/sec
[  5]   1.00-2.00   sec  6.97 MBytes  58.5 Mbits/sec
[  5]   2.00-3.00   sec  6.96 MBytes  58.3 Mbits/sec
[  5]   3.00-4.00   sec  7.06 MBytes  59.2 Mbits/sec
[  5]   4.00-5.00   sec  6.98 MBytes  58.5 Mbits/sec
[  5]   5.00-6.00   sec  6.97 MBytes  58.5 Mbits/sec
[  5]   6.00-7.00   sec  6.94 MBytes  58.2 Mbits/sec
[  5]   7.00-8.00   sec  7.06 MBytes  59.2 Mbits/sec
[  5]   8.00-9.00   sec  7.06 MBytes  59.2 Mbits/sec
[  5]   9.00-10.00  sec  7.07 MBytes  59.3 Mbits/sec
[  5]  10.00-10.05  sec   324 KBytes  58.4 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-10.05  sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-10.05  sec  69.8 MBytes  58.3 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

解释说明

Connecting to host 192.168.33.1, port 5201

这行信息表明客户端正在尝试连接到指定 IP 地址(192.168.33.1)和端口(5201)的服务器。

[  5] local 192.168.33.32 port 44558 connected to 192.168.33.1 port 5201

连接已成功建立。[ 5] 是该连接的标识符,local 192.168.33.32 port 44558 表示客户端本地的 IP 地址和端口,connected to 192.168.33.1 port 5201 表示成功连接到服务器的 IP 地址和端口。

[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  7.39 MBytes  61.9 Mbits/sec    0    165 KBytes 
  • [ ID]:连接的标识符,用于区分不同的连接或流。
  • Interval:表示统计的时间间隔,这里是从测试开始的 0.00 秒到 1.00 秒。
  • Transfer:在该时间间隔内传输的数据量。
  • Bandwidth:该时间间隔内的传输速率,单位为 Mbits/sec(兆比特每秒)。
  • Retr:每个线程和汇总的 TCP 重传数据包数量,用于评估网络的性能和稳定性

2.2 长时间测试+大窗口

测试 10 秒,窗口大小设为 100KB(适合高延迟网络)。

iperf3 -c 192.168.33.1 -t 10 -w 100KB

客户端输出示例:

yoyo@yoyo:~/360Downloads/iperf-3.18$ iperf3 -c 192.168.33.1 -t 10 -w 100KB
Connecting to host 192.168.33.1, port 5201
[  5] local 192.168.33.32 port 47076 connected to 192.168.33.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  6.70 MBytes  56.2 Mbits/sec    0    141 KBytes       
[  5]   1.00-2.00   sec  6.93 MBytes  58.1 Mbits/sec    0    141 KBytes       
[  5]   2.00-3.00   sec  6.83 MBytes  57.3 Mbits/sec    0    141 KBytes       
[  5]   3.00-4.00   sec  6.85 MBytes  57.5 Mbits/sec    0    141 KBytes       
[  5]   4.00-5.00   sec  6.78 MBytes  56.9 Mbits/sec    0    141 KBytes       
[  5]   5.00-6.00   sec  6.80 MBytes  57.0 Mbits/sec    0    141 KBytes       
[  5]   6.00-7.00   sec  6.93 MBytes  58.2 Mbits/sec    0    141 KBytes       
[  5]   7.00-8.00   sec  6.69 MBytes  56.1 Mbits/sec    0    141 KBytes       
[  5]   8.00-9.00   sec  6.88 MBytes  57.7 Mbits/sec    0    141 KBytes       
[  5]   9.00-10.47  sec  5.25 MBytes  30.0 Mbits/sec    0    141 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.47  sec  66.6 MBytes  53.4 Mbits/sec    0             sender
[  5]   0.00-10.47  sec  66.6 MBytes  53.4 Mbits/sec                  receiveriperf Done.

服务端输出示例:

Accepted connection from 192.168.33.32, port 47060
[  5] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 47076
[ 1807.087111] RTW: send eapol packet - WPA Group Key 1/2
[ 1807.107409] RTW: recv eapol packet - WPA Group Key 2/2
[ 1807.107910] RTW: set group key camid:0, addr:9a:03:cf:b5:cb:90, kid:2, type:AES
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec  6.36 MBytes  53.3 Mbits/sec
[  5]   1.00-2.00   sec  6.88 MBytes  57.7 Mbits/sec
[  5]   2.00-3.00   sec  6.91 MBytes  58.0 Mbits/sec
[  5]   3.00-4.00   sec  6.86 MBytes  57.5 Mbits/sec
[  5]   4.00-5.00   sec  6.82 MBytes  57.2 Mbits/sec
[  5]   5.00-6.00   sec  6.83 MBytes  57.3 Mbits/sec
[  5]   6.00-7.00   sec  6.82 MBytes  57.2 Mbits/sec
[  5]   7.00-8.00   sec  6.80 MBytes  57.1 Mbits/sec
[  5]   8.00-9.00   sec  6.71 MBytes  56.3 Mbits/sec
[  5]   9.00-10.00  sec  5.52 MBytes  46.3 Mbits/sec
[  5]  10.00-10.50  sec  98.6 KBytes  1.62 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-10.50  sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-10.50  sec  66.6 MBytes  53.2 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

2.3 反向模式测试(服务端到客户端)

iperf3 -c 192.168.33.1 -R

客户端输出示例:

yoyo@yoyo:~/360Downloads/iperf-3.18$ iperf3 -c 192.168.33.1 -R
Connecting to host 192.168.33.1, port 5201
Reverse mode, remote host 192.168.33.1 is sending
[  5] local 192.168.33.32 port 50130 connected to 192.168.33.1 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  5.62 MBytes  47.1 Mbits/sec                  
[  5]   1.00-2.00   sec  5.56 MBytes  46.7 Mbits/sec                  
[  5]   2.00-3.00   sec  5.50 MBytes  46.1 Mbits/sec                  
[  5]   3.00-4.00   sec  5.60 MBytes  47.0 Mbits/sec                  
[  5]   4.00-5.00   sec  5.61 MBytes  47.1 Mbits/sec                  
[  5]   5.00-6.00   sec  5.58 MBytes  46.8 Mbits/sec                  
[  5]   6.00-7.00   sec  5.50 MBytes  46.2 Mbits/sec                  
[  5]   7.00-8.00   sec  5.67 MBytes  47.6 Mbits/sec                  
[  5]   8.00-9.00   sec  5.65 MBytes  47.4 Mbits/sec                  
[  5]   9.00-10.00  sec  5.66 MBytes  47.5 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  56.2 MBytes  47.2 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  56.0 MBytes  47.0 Mbits/sec                  receiveriperf Done.

服务端输出示例:

Accepted connection from 192.168.33.32, port 50118
[  5] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 50130
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  5]   0.00-1.00   sec  5.77 MBytes  48.4 Mbits/sec    0    495 KBytes
[  5]   1.00-2.00   sec  5.58 MBytes  46.8 Mbits/sec    0    550 KBytes
[  5]   2.00-3.00   sec  5.42 MBytes  45.5 Mbits/sec    0    550 KBytes
[  5]   3.00-4.00   sec  5.59 MBytes  46.9 Mbits/sec    0    550 KBytes
[  5]   4.00-5.00   sec  5.76 MBytes  48.3 Mbits/sec    0    550 KBytes
[  5]   5.00-6.00   sec  5.38 MBytes  45.1 Mbits/sec    0    550 KBytes
[  5]   6.00-7.00   sec  5.72 MBytes  48.0 Mbits/sec    0    550 KBytes
[  5]   7.00-8.00   sec  5.65 MBytes  47.4 Mbits/sec    0    550 KBytes
[  5]   8.00-9.00   sec  5.53 MBytes  46.4 Mbits/sec    0    550 KBytes
[  5]   9.00-10.00  sec  5.65 MBytes  47.4 Mbits/sec    0    550 KBytes
[  5]  10.00-10.03  sec   191 KBytes  54.3 Mbits/sec    0    550 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  5]   0.00-10.03  sec  56.2 MBytes  47.0 Mbits/sec    0             sender
[  5]   0.00-10.03  sec  0.00 Bytes  0.00 bits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

2.4 多连接并发测试

iperf3 -c 192.168.33.1 -P 4

客户端输出示例:

yoyo@yoyo:~/360Downloads/iperf-3.18$ iperf3 -c 192.168.33.1 -P 4
Connecting to host 192.168.33.1, port 5201
[  5] local 192.168.33.32 port 42346 connected to 192.168.33.1 port 5201
[  7] local 192.168.33.32 port 42362 connected to 192.168.33.1 port 5201
[  9] local 192.168.33.32 port 42368 connected to 192.168.33.1 port 5201
[ 11] local 192.168.33.32 port 42380 connected to 192.168.33.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  2.29 MBytes  19.2 Mbits/sec    0    156 KBytes       
[  7]   0.00-1.00   sec  2.47 MBytes  20.7 Mbits/sec    0    165 KBytes       
[  9]   0.00-1.00   sec  2.76 MBytes  23.1 Mbits/sec    0    165 KBytes       
[ 11]   0.00-1.00   sec  2.06 MBytes  17.3 Mbits/sec    0    146 KBytes       
[SUM]   0.00-1.00   sec  9.59 MBytes  80.3 Mbits/sec    0             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   1.00-2.00   sec  1.86 MBytes  15.7 Mbits/sec    0    167 KBytes       
[  7]   1.00-2.00   sec  1.86 MBytes  15.7 Mbits/sec    0    165 KBytes       
[  9]   1.00-2.00   sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[ 11]   1.00-2.00   sec  1.80 MBytes  15.1 Mbits/sec    0    165 KBytes       
[SUM]   1.00-2.00   sec  7.02 MBytes  58.9 Mbits/sec    0             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   2.00-3.00   sec  1.49 MBytes  12.5 Mbits/sec    0    167 KBytes       
[  7]   2.00-3.00   sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[  9]   2.00-3.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[ 11]   2.00-3.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[SUM]   2.00-3.00   sec  6.71 MBytes  56.3 Mbits/sec    0             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   3.00-4.00   sec  1.86 MBytes  15.6 Mbits/sec    0    167 KBytes       
[  7]   3.00-4.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[  9]   3.00-4.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[ 11]   3.00-4.00   sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[SUM]   3.00-4.00   sec  7.08 MBytes  59.4 Mbits/sec    0             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   4.00-5.00   sec  1.49 MBytes  12.5 Mbits/sec    0    167 KBytes       
[  7]   4.00-5.00   sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[  9]   4.00-5.00   sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[ 11]   4.00-5.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[SUM]   4.00-5.00   sec  6.34 MBytes  53.2 Mbits/sec    0             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   5.00-6.00   sec  1.86 MBytes  15.6 Mbits/sec    0    167 KBytes       
[  7]   5.00-6.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[  9]   5.00-6.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[ 11]   5.00-6.00   sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[SUM]   5.00-6.00   sec  7.08 MBytes  59.4 Mbits/sec    0             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   6.00-7.00   sec  1.86 MBytes  15.6 Mbits/sec    0    167 KBytes       
[  7]   6.00-7.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[  9]   6.00-7.00   sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[ 11]   6.00-7.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[SUM]   6.00-7.00   sec  7.08 MBytes  59.5 Mbits/sec    0             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   7.00-8.00   sec  1.49 MBytes  12.5 Mbits/sec    0    167 KBytes       
[  7]   7.00-8.00   sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[  9]   7.00-8.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[ 11]   7.00-8.00   sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[SUM]   7.00-8.00   sec  6.34 MBytes  53.1 Mbits/sec    0             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   8.00-9.00   sec  1.86 MBytes  15.6 Mbits/sec    0    167 KBytes       
[  7]   8.00-9.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[  9]   8.00-9.00   sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[ 11]   8.00-9.00   sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[SUM]   8.00-9.00   sec  7.08 MBytes  59.4 Mbits/sec    0             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   9.00-10.00  sec  1.49 MBytes  12.5 Mbits/sec    0    167 KBytes       
[  7]   9.00-10.00  sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[  9]   9.00-10.00  sec  1.86 MBytes  15.6 Mbits/sec    0    165 KBytes       
[ 11]   9.00-10.00  sec  1.49 MBytes  12.5 Mbits/sec    0    165 KBytes       
[SUM]   9.00-10.00  sec  6.34 MBytes  53.2 Mbits/sec    0             
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  17.6 MBytes  14.7 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  17.0 MBytes  14.3 Mbits/sec                  receiver
[  7]   0.00-10.00  sec  17.8 MBytes  14.9 Mbits/sec    0             sender
[  7]   0.00-10.00  sec  17.2 MBytes  14.5 Mbits/sec                  receiver
[  9]   0.00-10.00  sec  18.0 MBytes  15.1 Mbits/sec    0             sender
[  9]   0.00-10.00  sec  17.4 MBytes  14.6 Mbits/sec                  receiver
[ 11]   0.00-10.00  sec  17.3 MBytes  14.5 Mbits/sec    0             sender
[ 11]   0.00-10.00  sec  16.8 MBytes  14.1 Mbits/sec                  receiver
[SUM]   0.00-10.00  sec  70.7 MBytes  59.3 Mbits/sec    0             sender
[SUM]   0.00-10.00  sec  68.4 MBytes  57.4 Mbits/sec                  receiveriperf Done.

服务端输出示例:

Accepted connection from 192.168.33.32, port 42340
[  5] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 42346
[  7] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 42362
[  9] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 42368
[ 11] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 42380
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec  1.55 MBytes  13.0 Mbits/sec
[  7]   0.00-1.00   sec  1.82 MBytes  15.3 Mbits/sec
[  9]   0.00-1.00   sec  1.99 MBytes  16.7 Mbits/sec
[ 11]   0.00-1.00   sec  1.45 MBytes  12.2 Mbits/sec
[SUM]   0.00-1.00   sec  6.82 MBytes  57.2 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   1.00-2.00   sec  1.69 MBytes  14.2 Mbits/sec
[  7]   1.00-2.00   sec  1.69 MBytes  14.1 Mbits/sec
[  9]   1.00-2.00   sec  1.69 MBytes  14.2 Mbits/sec
[ 11]   1.00-2.00   sec  1.66 MBytes  13.9 Mbits/sec
[SUM]   1.00-2.00   sec  6.73 MBytes  56.4 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   2.00-3.00   sec  1.71 MBytes  14.4 Mbits/sec
[  7]   2.00-3.00   sec  1.71 MBytes  14.3 Mbits/sec
[  9]   2.00-3.00   sec  1.70 MBytes  14.2 Mbits/sec
[ 11]   2.00-3.00   sec  1.69 MBytes  14.2 Mbits/sec
[SUM]   2.00-3.00   sec  6.81 MBytes  57.1 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   3.00-4.00   sec  1.72 MBytes  14.4 Mbits/sec
[  7]   3.00-4.00   sec  1.71 MBytes  14.3 Mbits/sec
[  9]   3.00-4.00   sec  1.70 MBytes  14.3 Mbits/sec
[ 11]   3.00-4.00   sec  1.70 MBytes  14.3 Mbits/sec
[SUM]   3.00-4.00   sec  6.83 MBytes  57.3 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   4.00-5.00   sec  1.69 MBytes  14.2 Mbits/sec
[  7]   4.00-5.00   sec  1.68 MBytes  14.1 Mbits/sec
[  9]   4.00-5.00   sec  1.68 MBytes  14.1 Mbits/sec
[ 11]   4.00-5.00   sec  1.69 MBytes  14.2 Mbits/sec
[SUM]   4.00-5.00   sec  6.74 MBytes  56.6 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   5.00-6.00   sec  1.72 MBytes  14.4 Mbits/sec
[  7]   5.00-6.00   sec  1.71 MBytes  14.3 Mbits/sec
[  9]   5.00-6.00   sec  1.70 MBytes  14.3 Mbits/sec
[ 11]   5.00-6.00   sec  1.70 MBytes  14.2 Mbits/sec
[SUM]   5.00-6.00   sec  6.82 MBytes  57.2 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   6.00-7.00   sec  1.72 MBytes  14.4 Mbits/sec
[  7]   6.00-7.00   sec  1.72 MBytes  14.4 Mbits/sec
[  9]   6.00-7.00   sec  1.72 MBytes  14.4 Mbits/sec
[ 11]   6.00-7.00   sec  1.71 MBytes  14.4 Mbits/sec
[SUM]   6.00-7.00   sec  6.87 MBytes  57.6 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   7.00-8.00   sec  1.67 MBytes  14.0 Mbits/sec
[  7]   7.00-8.00   sec  1.67 MBytes  14.0 Mbits/sec
[  9]   7.00-8.00   sec  1.66 MBytes  13.9 Mbits/sec
[ 11]   7.00-8.00   sec  1.66 MBytes  13.9 Mbits/sec
[SUM]   7.00-8.00   sec  6.65 MBytes  55.8 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   8.00-9.00   sec  1.70 MBytes  14.3 Mbits/sec
[  7]   8.00-9.00   sec  1.70 MBytes  14.3 Mbits/sec
[  9]   8.00-9.00   sec  1.71 MBytes  14.3 Mbits/sec
[ 11]   8.00-9.00   sec  1.70 MBytes  14.2 Mbits/sec
[SUM]   8.00-9.00   sec  6.81 MBytes  57.1 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   9.00-10.00  sec  1.71 MBytes  14.3 Mbits/sec
[  7]   9.00-10.00  sec  1.70 MBytes  14.3 Mbits/sec
[  9]   9.00-10.00  sec  1.70 MBytes  14.3 Mbits/sec
[ 11]   9.00-10.00  sec  1.69 MBytes  14.2 Mbits/sec
[SUM]   9.00-10.00  sec  6.80 MBytes  57.1 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]  10.00-10.08  sec   144 KBytes  15.1 Mbits/sec
[  7]  10.00-10.08  sec   139 KBytes  14.5 Mbits/sec
[  9]  10.00-10.08  sec   124 KBytes  13.0 Mbits/sec
[ 11]  10.00-10.08  sec   136 KBytes  14.2 Mbits/sec
[SUM]  10.00-10.08  sec   543 KBytes  56.9 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-10.08  sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-10.08  sec  17.0 MBytes  14.2 Mbits/sec                  receiver
[  7]   0.00-10.08  sec  0.00 Bytes  0.00 bits/sec                  sender
[  7]   0.00-10.08  sec  17.2 MBytes  14.4 Mbits/sec                  receiver
[  9]   0.00-10.08  sec  0.00 Bytes  0.00 bits/sec                  sender
[  9]   0.00-10.08  sec  17.4 MBytes  14.5 Mbits/sec                  receiver
[ 11]   0.00-10.08  sec  0.00 Bytes  0.00 bits/sec                  sender
[ 11]   0.00-10.08  sec  16.8 MBytes  14.0 Mbits/sec                  receiver
[SUM]   0.00-10.08  sec  0.00 Bytes  0.00 bits/sec                  sender
[SUM]   0.00-10.08  sec  68.4 MBytes  56.9 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

2.5 绑定本地网卡+JSON输出

iperf3 -c 192.168.33.1 -B 192.168.33.32 --json

客户端输出示例:

yoyo@yoyo:~/360Downloads/iperf-3.18$ iperf3 -c 192.168.33.1 -B 192.168.33.32 --json
{"start":	{"connected":	[{"socket":	5,"local_host":	"192.168.33.32","local_port":	38929,"remote_host":	"192.168.33.1","remote_port":	5201}],"version":	"iperf 3.7","system_info":	"Linux ubuntu 5.15.0-127-generic #137~20.04.1-Ubuntu SMP Fri Nov 15 14:46:54 UTC 2024 x86_64","timestamp":	{"time":	"Fri, 07 Mar 2025 08:25:12 GMT","timesecs":	1741335912},"connecting_to":	{"host":	"192.168.33.1","port":	5201},"cookie":	"cacdolyx3zqp4g23imznntfjrwnfcn5kuaea","tcp_mss_default":	1448,"sock_bufsize":	0,"sndbuf_actual":	16384,"rcvbuf_actual":	131072,"test_start":	{"protocol":	"TCP","num_streams":	1,"blksize":	131072,"omit":	0,"duration":	10,"bytes":	0,"blocks":	0,"reverse":	0,"tos":	0}},"intervals":	[{"streams":	[{"socket":	5,"start":	0,"end":	1.000917,"seconds":	1.0009169578552246,"bytes":	7681640,"bits_per_second":	61396821.702054478,"retransmits":	0,"snd_cwnd":	169416,"rtt":	19162,"rttvar":	4737,"pmtu":	1500,"omitted":	false,"sender":	true}],"sum":	{"start":	0,"end":	1.000917,"seconds":	1.0009169578552246,"bytes":	7681640,"bits_per_second":	61396821.702054478,"retransmits":	0,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	1.000917,"end":	2.0001,"seconds":	0.99918299913406372,"bytes":	7297920,"bits_per_second":	58431098.257874288,"retransmits":	0,"snd_cwnd":	169416,"rtt":	23765,"rttvar":	904,"pmtu":	1500,"omitted":	false,"sender":	true}],"sum":	{"start":	1.000917,"end":	2.0001,"seconds":	0.99918299913406372,"bytes":	7297920,"bits_per_second":	58431098.257874288,"retransmits":	0,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	2.0001,"end":	3.000746,"seconds":	1.0006459951400757,"bytes":	7167600,"bits_per_second":	57303782.035297245,"retransmits":	0,"snd_cwnd":	169416,"rtt":	18039,"rttvar":	2825,"pmtu":	1500,"omitted":	false,"sender":	true}],"sum":	{"start":	2.0001,"end":	3.000746,"seconds":	1.0006459951400757,"bytes":	7167600,"bits_per_second":	57303782.035297245,"retransmits":	0,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	3.000746,"end":	4.000225,"seconds":	0.99947899580001831,"bytes":	7232760,"bits_per_second":	57892242.101281121,"retransmits":	0,"snd_cwnd":	169416,"rtt":	18355,"rttvar":	921,"pmtu":	1500,"omitted":	false,"sender":	true}],"sum":	{"start":	3.000746,"end":	4.000225,"seconds":	0.99947899580001831,"bytes":	7232760,"bits_per_second":	57892242.101281121,"retransmits":	0,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	4.000225,"end":	5.000468,"seconds":	1.0002429485321045,"bytes":	7623720,"bits_per_second":	60974946.226319164,"retransmits":	0,"snd_cwnd":	169416,"rtt":	14811,"rttvar":	4217,"pmtu":	1500,"omitted":	false,"sender":	true}],"sum":	{"start":	4.000225,"end":	5.000468,"seconds":	1.0002429485321045,"bytes":	7623720,"bits_per_second":	60974946.226319164,"retransmits":	0,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	5.000468,"end":	6.000275,"seconds":	0.99980700016021729,"bytes":	7102440,"bits_per_second":	56830488.275131874,"retransmits":	0,"snd_cwnd":	169416,"rtt":	15805,"rttvar":	4878,"pmtu":	1500,"omitted":	false,"sender":	true}],"sum":	{"start":	5.000468,"end":	6.000275,"seconds":	0.99980700016021729,"bytes":	7102440,"bits_per_second":	56830488.275131874,"retransmits":	0,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	6.000275,"end":	7.000953,"seconds":	1.0006779432296753,"bytes":	6906960,"bits_per_second":	55218245.164536156,"retransmits":	0,"snd_cwnd":	169416,"rtt":	14148,"rttvar":	2077,"pmtu":	1500,"omitted":	false,"sender":	true}],"sum":	{"start":	6.000275,"end":	7.000953,"seconds":	1.0006779432296753,"bytes":	6906960,"bits_per_second":	55218245.164536156,"retransmits":	0,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	7.000953,"end":	8.001069,"seconds":	1.0001159906387329,"bytes":	7297920,"bits_per_second":	58376588.86217083,"retransmits":	0,"snd_cwnd":	169416,"rtt":	16196,"rttvar":	4093,"pmtu":	1500,"omitted":	false,"sender":	true}],"sum":	{"start":	7.000953,"end":	8.001069,"seconds":	1.0001159906387329,"bytes":	7297920,"bits_per_second":	58376588.86217083,"retransmits":	0,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	8.001069,"end":	9.000902,"seconds":	0.99983298778533936,"bytes":	7167600,"bits_per_second":	57350378.213677093,"retransmits":	0,"snd_cwnd":	169416,"rtt":	24556,"rttvar":	3826,"pmtu":	1500,"omitted":	false,"sender":	true}],"sum":	{"start":	8.001069,"end":	9.000902,"seconds":	0.99983298778533936,"bytes":	7167600,"bits_per_second":	57350378.213677093,"retransmits":	0,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	9.000902,"end":	10.000237,"seconds":	0.999334990978241,"bytes":	7428240,"bits_per_second":	59465465.070755146,"retransmits":	0,"snd_cwnd":	169416,"rtt":	14706,"rttvar":	4834,"pmtu":	1500,"omitted":	false,"sender":	true}],"sum":	{"start":	9.000902,"end":	10.000237,"seconds":	0.999334990978241,"bytes":	7428240,"bits_per_second":	59465465.070755146,"retransmits":	0,"omitted":	false,"sender":	true}}],"end":	{"streams":	[{"sender":	{"socket":	5,"start":	0,"end":	10.000237,"seconds":	10.000237,"bytes":	72906800,"bits_per_second":	58324057.71983204,"retransmits":	0,"max_snd_cwnd":	169416,"max_rtt":	24556,"min_rtt":	14148,"mean_rtt":	17954,"sender":	true},"receiver":	{"socket":	5,"start":	0,"end":	10.000237,"seconds":	10.000237,"bytes":	72163976,"bits_per_second":	57729812.6034413,"sender":	true}}],"sum_sent":	{"start":	0,"end":	10.000237,"seconds":	10.000237,"bytes":	72906800,"bits_per_second":	58324057.71983204,"retransmits":	0,"sender":	true},"sum_received":	{"start":	0,"end":	10.000237,"seconds":	10.000237,"bytes":	72163976,"bits_per_second":	57729812.6034413,"sender":	true},"cpu_utilization_percent":	{"host_total":	1.2980239879591693,"host_user":	0,"host_system":	1.298014040805413,"remote_total":	1.393921,"remote_user":	0.192229,"remote_system":	1.201686},"sender_tcp_congestion":	"cubic"}
}

服务端输出示例:

Accepted connection from 192.168.33.32, port 56183
[  5] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 38929
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec  6.46 MBytes  54.2 Mbits/sec
[  5]   1.00-2.00   sec  6.85 MBytes  57.4 Mbits/sec
[  5]   2.00-3.00   sec  6.93 MBytes  58.2 Mbits/sec
[  5]   3.00-4.00   sec  6.97 MBytes  58.5 Mbits/sec
[  5]   4.00-5.00   sec  6.96 MBytes  58.4 Mbits/sec
[  5]   5.00-6.00   sec  6.85 MBytes  57.4 Mbits/sec
[  5]   6.00-7.00   sec  6.76 MBytes  56.7 Mbits/sec
[  5]   7.00-8.00   sec  6.99 MBytes  58.6 Mbits/sec
[  5]   8.00-9.00   sec  6.90 MBytes  57.9 Mbits/sec
[  5]   9.00-10.00  sec  6.84 MBytes  57.4 Mbits/sec
[  5]  10.00-10.05  sec   322 KBytes  57.8 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-10.05  sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-10.05  sec  68.8 MBytes  57.5 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

3. 启动iperf3客户端(UDP模式)

参数说明
-u启动UDP模式
-b <带宽>指定目标带宽(如 -b 100M 表示 100 Mbps)
-l <包大小>设置数据包长度(默认 1470 Bytes)
-t <秒>测试时长
--json以 JSON 格式输出结果(方便自动化处理)

3.1 基础测试(默认参数)

基本 UDP 测试(默认带宽 1 Mbps)。

iperf3 -c 192.168.33.1 -u

客户端输出示例:

yoyo@yoyo:~/360Downloads/iperf-3.18$ iperf3 -c 192.168.33.1 -u
Connecting to host 192.168.33.1, port 5201
[  5] local 192.168.33.32 port 48231 connected to 192.168.33.1 port 5201
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  5]   0.00-1.00   sec   129 KBytes  1.05 Mbits/sec  91  
[  5]   1.00-2.00   sec   129 KBytes  1.05 Mbits/sec  91  
[  5]   2.00-3.00   sec   127 KBytes  1.04 Mbits/sec  90  
[  5]   3.00-4.00   sec   129 KBytes  1.05 Mbits/sec  91  
[  5]   4.00-5.00   sec   127 KBytes  1.04 Mbits/sec  90  
[  5]   5.00-6.00   sec   129 KBytes  1.05 Mbits/sec  91  
[  5]   6.00-7.00   sec   127 KBytes  1.04 Mbits/sec  90  
[  5]   7.00-8.00   sec   129 KBytes  1.05 Mbits/sec  91  
[  5]   8.00-9.00   sec   127 KBytes  1.04 Mbits/sec  90  
[  5]   9.00-10.00  sec   129 KBytes  1.05 Mbits/sec  91  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  1.25 MBytes  1.05 Mbits/sec  0.000 ms  0/906 (0%)  sender
[  5]   0.00-10.00  sec  1.25 MBytes  1.05 Mbits/sec  0.966 ms  0/906 (0%)  receiveriperf Done.

服务端输出示例:

Accepted connection from 192.168.33.32, port 52598
[  5] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 48231
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  5]   0.00-1.00   sec   122 KBytes   996 Kbits/sec  254195.098 ms  0/86 (0%)
[  5]   1.00-2.00   sec   129 KBytes  1.05 Mbits/sec  716.354 ms  0/91 (0%)
[  5]   2.00-3.00   sec   127 KBytes  1.04 Mbits/sec  3.403 ms  0/90 (0%)
[  5]   3.00-4.00   sec   129 KBytes  1.05 Mbits/sec  1.341 ms  0/91 (0%)
[  5]   4.00-5.00   sec   127 KBytes  1.04 Mbits/sec  1.079 ms  0/90 (0%)
[  5]   5.00-6.00   sec   129 KBytes  1.05 Mbits/sec  1.065 ms  0/91 (0%)
[  5]   6.00-7.00   sec   127 KBytes  1.04 Mbits/sec  1.258 ms  0/90 (0%)
[  5]   7.00-8.00   sec   129 KBytes  1.05 Mbits/sec  0.483 ms  0/91 (0%)
[  5]   8.00-9.00   sec   127 KBytes  1.04 Mbits/sec  1.027 ms  0/90 (0%)
[  5]   9.00-10.00  sec   129 KBytes  1.05 Mbits/sec  0.991 ms  0/91 (0%)
[  5]  10.00-10.06  sec  7.07 KBytes  1.04 Mbits/sec  0.966 ms  0/5 (0%)
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  5]   0.00-10.06  sec  0.00 Bytes  0.00 bits/sec  0.966 ms  0/906 (0%)
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

3.2 长时间测试+限制带宽

限制带宽为 50Mbps,测试 20 秒。

iperf3 -c 192.168.33.1 -u -b 100M -t 20

客户端输出示例:

yoyo@yoyo:~/360Downloads/iperf-3.18$ iperf3 -c 192.168.33.1 -u -b 100M -t 20
Connecting to host 192.168.33.1, port 5201
[  5] local 192.168.33.32 port 59710 connected to 192.168.33.1 port 5201
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  5]   0.00-1.00   sec  11.9 MBytes  99.9 Mbits/sec  8627  
[  5]   1.00-2.00   sec  11.9 MBytes   100 Mbits/sec  8632  
[  5]   2.00-3.00   sec  11.9 MBytes   100 Mbits/sec  8632  
[  5]   3.00-4.00   sec  11.9 MBytes   100 Mbits/sec  8635  
[  5]   4.00-5.00   sec  11.9 MBytes   100 Mbits/sec  8631  
[  5]   5.00-6.00   sec  11.9 MBytes  99.9 Mbits/sec  8632  
[  5]   6.00-7.00   sec  11.9 MBytes   100 Mbits/sec  8637  
[  5]   7.00-8.00   sec  11.9 MBytes  99.9 Mbits/sec  8631  
[  5]   8.00-9.00   sec  11.9 MBytes   100 Mbits/sec  8627  
[  5]   9.00-10.00  sec  11.9 MBytes   100 Mbits/sec  8635  
[  5]  10.00-11.00  sec  11.9 MBytes   100 Mbits/sec  8639  
[  5]  11.00-12.00  sec  11.9 MBytes   100 Mbits/sec  8627  
[  5]  12.00-13.00  sec  11.9 MBytes   100 Mbits/sec  8637  
[  5]  13.00-14.00  sec  11.9 MBytes   100 Mbits/sec  8633  
[  5]  14.00-15.00  sec  11.9 MBytes   100 Mbits/sec  8629  
[  5]  15.00-16.00  sec  11.9 MBytes   100 Mbits/sec  8634  
[  5]  16.00-17.00  sec  11.9 MBytes  99.9 Mbits/sec  8630  
[  5]  17.00-18.00  sec  11.9 MBytes   100 Mbits/sec  8639  
[  5]  18.00-19.00  sec  11.9 MBytes  99.9 Mbits/sec  8626  
[  5]  19.00-20.00  sec  11.9 MBytes   100 Mbits/sec  8637  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-20.00  sec   238 MBytes   100 Mbits/sec  0.000 ms  0/172650 (0%)  sender
[  5]   0.00-20.00  sec   238 MBytes   100 Mbits/sec  0.253 ms  0/172647 (0%)  receiveriperf Done.

服务端输出示例:

Accepted connection from 192.168.33.32, port 58258
[  5] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 59710
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  5]   0.00-1.00   sec  7.06 MBytes  59.2 Mbits/sec  0.252 ms  0/5109 (0%)
[  5]   1.00-2.00   sec  7.02 MBytes  58.9 Mbits/sec  0.200 ms  0/5087 (0%)
[  5]   2.00-3.00   sec  7.32 MBytes  61.4 Mbits/sec  0.406 ms  0/5300 (0%)
[  5]   3.00-4.00   sec  7.16 MBytes  60.1 Mbits/sec  0.244 ms  0/5187 (0%)
[  5]   4.00-5.00   sec  7.20 MBytes  60.4 Mbits/sec  0.319 ms  0/5211 (0%)
[  5]   5.00-6.00   sec  7.49 MBytes  62.8 Mbits/sec  0.150 ms  0/5422 (0%)
[  5]   6.00-7.00   sec  7.30 MBytes  61.2 Mbits/sec  0.123 ms  0/5286 (0%)
[  5]   7.00-8.00   sec  7.20 MBytes  60.4 Mbits/sec  0.294 ms  0/5213 (0%)
[  5]   8.00-9.00   sec  7.18 MBytes  60.2 Mbits/sec  0.205 ms  0/5200 (0%)
[  5]   9.00-10.00  sec  7.46 MBytes  62.6 Mbits/sec  0.164 ms  0/5401 (0%)
[  5]  10.00-11.00  sec  7.26 MBytes  60.8 Mbits/sec  0.288 ms  0/5257 (0%)
[  5]  11.00-12.00  sec  7.37 MBytes  61.9 Mbits/sec  0.303 ms  0/5340 (0%)
[  5]  12.00-13.00  sec  7.20 MBytes  60.4 Mbits/sec  0.217 ms  0/5216 (0%)
[  5]  13.00-14.00  sec  7.10 MBytes  59.6 Mbits/sec  0.195 ms  0/5144 (0%)
[  5]  14.00-15.00  sec  7.15 MBytes  60.0 Mbits/sec  0.226 ms  0/5181 (0%)
[  5]  15.00-16.00  sec  6.45 MBytes  54.1 Mbits/sec  0.334 ms  0/4669 (0%)
[  5]  16.00-17.00  sec  7.46 MBytes  62.6 Mbits/sec  0.230 ms  0/5401 (0%)
[  5]  17.00-18.00  sec  6.88 MBytes  57.7 Mbits/sec  0.221 ms  0/4979 (0%)
[  5]  18.00-19.00  sec  7.41 MBytes  62.1 Mbits/sec  0.208 ms  0/5365 (0%)
[  5]  19.00-20.00  sec  7.09 MBytes  59.5 Mbits/sec  0.316 ms  0/5135 (0%)
[  5]  20.00-21.00  sec  7.30 MBytes  61.2 Mbits/sec  0.221 ms  0/5283 (0%)
[  5]  21.00-22.00  sec  7.32 MBytes  61.4 Mbits/sec  0.291 ms  0/5304 (0%)
[  5]  22.00-23.00  sec  7.38 MBytes  61.9 Mbits/sec  0.217 ms  0/5346 (0%)
[  5]  23.00-24.00  sec  7.54 MBytes  63.2 Mbits/sec  0.211 ms  0/5460 (0%)
[  5]  24.00-25.00  sec  7.39 MBytes  62.0 Mbits/sec  0.211 ms  0/5349 (0%)
[  5]  25.00-26.00  sec  7.45 MBytes  62.5 Mbits/sec  0.215 ms  0/5397 (0%)
[  5]  26.00-27.00  sec  7.43 MBytes  62.4 Mbits/sec  0.212 ms  0/5383 (0%)
[  5]  27.00-28.00  sec  7.50 MBytes  62.9 Mbits/sec  0.256 ms  0/5432 (0%)
[  5]  28.00-29.00  sec  7.40 MBytes  62.1 Mbits/sec  0.177 ms  0/5359 (0%)
[  5]  29.00-30.00  sec  7.50 MBytes  62.9 Mbits/sec  0.244 ms  0/5430 (0%)
[  5]  30.00-31.00  sec  7.63 MBytes  64.0 Mbits/sec  0.175 ms  0/5523 (0%)
[  5]  31.00-32.00  sec  7.45 MBytes  62.5 Mbits/sec  0.242 ms  0/5393 (0%)
[  5]  32.00-32.74  sec  5.36 MBytes  60.7 Mbits/sec  0.253 ms  0/3885 (0%)
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  5]   0.00-32.74  sec  0.00 Bytes  0.00 bits/sec  0.253 ms  0/172647 (0%)
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

3.3 指定带宽大小

iperf3 -c 192.168.33.1 -u -b 200M

客户端输出示例:

yoyo@yoyo:~/360Downloads/iperf-3.18$ iperf3 -c 192.168.33.1 -u -b 200M
Connecting to host 192.168.33.1, port 5201
[  5] local 192.168.33.32 port 60743 connected to 192.168.33.1 port 5201
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  5]   0.00-1.00   sec  23.8 MBytes   200 Mbits/sec  17253  
[  5]   1.00-2.00   sec  23.8 MBytes   200 Mbits/sec  17271  
[  5]   2.00-3.00   sec  23.8 MBytes   200 Mbits/sec  17266  
[  5]   3.00-4.00   sec  23.8 MBytes   200 Mbits/sec  17266  
[  5]   4.00-5.00   sec  23.8 MBytes   200 Mbits/sec  17266  
[  5]   5.00-6.00   sec  23.8 MBytes   200 Mbits/sec  17268  
[  5]   6.00-7.00   sec  23.8 MBytes   200 Mbits/sec  17262  
[  5]   7.00-8.00   sec  23.8 MBytes   200 Mbits/sec  17250  
[  5]   8.00-9.00   sec  2.58 MBytes  21.6 Mbits/sec  1869  
[  5]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec  0  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec   193 MBytes   162 Mbits/sec  0.000 ms  0/139971 (0%)  sender
[  5]   0.00-10.00  sec   193 MBytes   162 Mbits/sec  0.261 ms  0/139923 (0%)  receiveriperf Done.

服务端输出示例:

Accepted connection from 192.168.33.32, port 36808
[  5] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 60743
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  5]   0.00-1.00   sec  7.15 MBytes  60.0 Mbits/sec  0.154 ms  0/5177 (0%)
[  5]   1.00-2.00   sec  7.23 MBytes  60.7 Mbits/sec  0.285 ms  0/5237 (0%)
[  5]   2.00-3.00   sec  7.28 MBytes  61.1 Mbits/sec  0.169 ms  0/5272 (0%)
[  5]   3.00-4.00   sec  7.43 MBytes  62.3 Mbits/sec  0.151 ms  0/5377 (0%)
[  5]   4.00-5.00   sec  7.20 MBytes  60.4 Mbits/sec  0.168 ms  0/5215 (0%)
[  5]   5.00-6.00   sec  7.21 MBytes  60.5 Mbits/sec  0.185 ms  0/5219 (0%)
[  5]   6.00-7.00   sec  7.39 MBytes  62.0 Mbits/sec  0.193 ms  0/5351 (0%)
[  5]   7.00-8.00   sec  7.39 MBytes  62.0 Mbits/sec  0.134 ms  0/5353 (0%)
[  5]   8.00-9.00   sec  7.44 MBytes  62.4 Mbits/sec  0.157 ms  0/5391 (0%)
[  5]   9.00-10.00  sec  7.44 MBytes  62.4 Mbits/sec  0.185 ms  0/5386 (0%)
[  5]  10.00-11.00  sec  7.43 MBytes  62.3 Mbits/sec  0.155 ms  0/5378 (0%)
[  5]  11.00-12.00  sec  7.40 MBytes  62.1 Mbits/sec  0.128 ms  0/5359 (0%)
[  5]  12.00-13.00  sec  7.30 MBytes  61.2 Mbits/sec  0.232 ms  0/5287 (0%)
[  5]  13.00-14.00  sec  7.48 MBytes  62.8 Mbits/sec  0.199 ms  0/5419 (0%)
[  5]  14.00-15.00  sec  7.33 MBytes  61.5 Mbits/sec  0.200 ms  0/5309 (0%)
[  5]  15.00-16.00  sec  7.40 MBytes  62.1 Mbits/sec  0.203 ms  0/5357 (0%)
[  5]  16.00-17.00  sec  7.28 MBytes  61.1 Mbits/sec  0.175 ms  0/5274 (0%)
[  5]  17.00-18.00  sec  7.23 MBytes  60.7 Mbits/sec  0.127 ms  0/5239 (0%)
[  5]  18.00-19.00  sec  7.46 MBytes  62.6 Mbits/sec  0.178 ms  0/5402 (0%)
[  5]  19.00-20.00  sec  7.46 MBytes  62.6 Mbits/sec  0.157 ms  0/5405 (0%)
[  5]  20.00-21.00  sec  7.43 MBytes  62.4 Mbits/sec  0.160 ms  0/5383 (0%)
[  5]  21.00-22.00  sec  7.40 MBytes  62.0 Mbits/sec  0.164 ms  0/5356 (0%)
[  5]  22.00-23.00  sec  7.33 MBytes  61.5 Mbits/sec  0.253 ms  0/5305 (0%)
[  5]  23.00-24.00  sec  7.57 MBytes  63.5 Mbits/sec  0.238 ms  0/5485 (0%)
[  5]  24.00-25.00  sec  7.40 MBytes  62.1 Mbits/sec  0.234 ms  0/5359 (0%)
[  5]  25.00-26.00  sec  7.26 MBytes  60.9 Mbits/sec  0.216 ms  0/5256 (0%)
[  5]  26.00-26.26  sec  1.89 MBytes  61.7 Mbits/sec  0.261 ms  0/1372 (0%)
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  5]   0.00-26.26  sec  0.00 Bytes  0.00 bits/sec  0.261 ms  0/139923 (0%)
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

3.4 指定传输包大小

指定带宽 100Mbps,包大小 1200 Bytes。

iperf3 -c 192.168.33.1 -u -b 100M -l 1200

客户端输出示例:

yoyo@yoyo:~/360Downloads/iperf-3.18$ iperf3 -c 192.168.33.1 -u -b 100M -l 1200
Connecting to host 192.168.33.1, port 5201
[  5] local 192.168.33.32 port 59747 connected to 192.168.33.1 port 5201
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  5]   0.00-1.00   sec  11.9 MBytes  99.9 Mbits/sec  10404  
[  5]   1.00-2.00   sec  11.9 MBytes   100 Mbits/sec  10423  
[  5]   2.00-3.00   sec  11.9 MBytes   100 Mbits/sec  10413  
[  5]   3.00-4.00   sec  11.9 MBytes   100 Mbits/sec  10422  
[  5]   4.00-5.00   sec  11.9 MBytes   100 Mbits/sec  10412  
[  5]   5.00-6.00   sec  11.9 MBytes   100 Mbits/sec  10420  
[  5]   6.00-7.00   sec  11.9 MBytes   100 Mbits/sec  10420  
[  5]   7.00-8.00   sec  11.9 MBytes  99.9 Mbits/sec  10409  
[  5]   8.00-9.00   sec  11.9 MBytes   100 Mbits/sec  10421  
[  5]   9.00-10.00  sec  11.9 MBytes   100 Mbits/sec  10418  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec   119 MBytes   100 Mbits/sec  0.000 ms  0/104162 (0%)  sender
[  5]   0.00-10.00  sec   119 MBytes   100 Mbits/sec  0.167 ms  0/104158 (0%)  receiveriperf Done.

服务端输出示例:

Accepted connection from 192.168.33.32, port 51382
[  5] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 59747
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  5]   0.00-1.00   sec  6.81 MBytes  57.2 Mbits/sec  0.130 ms  0/5954 (0%)
[  5]   1.00-2.00   sec  7.23 MBytes  60.7 Mbits/sec  0.296 ms  0/6322 (0%)
[  5]   2.00-3.00   sec  7.34 MBytes  61.6 Mbits/sec  0.199 ms  0/6414 (0%)
[  5]   3.00-4.00   sec  7.02 MBytes  58.9 Mbits/sec  0.197 ms  0/6133 (0%)
[  5]   4.00-5.00   sec  7.30 MBytes  61.2 Mbits/sec  0.202 ms  0/6377 (0%)
[  5]   5.00-6.00   sec  7.25 MBytes  60.9 Mbits/sec  0.189 ms  0/6339 (0%)
[  5]   6.00-7.00   sec  7.31 MBytes  61.3 Mbits/sec  0.162 ms  0/6388 (0%)
[  5]   7.00-8.00   sec  7.32 MBytes  61.4 Mbits/sec  0.189 ms  0/6396 (0%)
[  5]   8.00-9.00   sec  7.30 MBytes  61.2 Mbits/sec  0.186 ms  0/6380 (0%)
[  5]   9.00-10.00  sec  7.41 MBytes  62.2 Mbits/sec  0.175 ms  0/6478 (0%)
[  5]  10.00-11.00  sec  7.22 MBytes  60.6 Mbits/sec  0.188 ms  0/6310 (0%)
[  5]  11.00-12.00  sec  7.37 MBytes  61.8 Mbits/sec  0.204 ms  0/6441 (0%)
[  5]  12.00-13.00  sec  7.28 MBytes  61.1 Mbits/sec  0.184 ms  0/6363 (0%)
[  5]  13.00-14.00  sec  7.29 MBytes  61.1 Mbits/sec  0.188 ms  0/6366 (0%)
[  5]  14.00-15.00  sec  7.28 MBytes  61.1 Mbits/sec  0.153 ms  0/6361 (0%)
[  5]  15.00-16.00  sec  7.26 MBytes  60.9 Mbits/sec  0.192 ms  0/6342 (0%)
[  5]  16.00-16.45  sec  3.20 MBytes  60.1 Mbits/sec  0.167 ms  0/2794 (0%)
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  5]   0.00-16.45  sec  0.00 Bytes  0.00 bits/sec  0.167 ms  0/104158 (0%)
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

3.5 显示抖动(jitter)和丢包率

iperf3 -c 192.168.33.1 -u -b 100M --json

客户端输出示例:

yoyo@yoyo:~/360Downloads/iperf-3.18$ iperf3 -c 192.168.33.1 -u -b 100M --json
{"start":	{"connected":	[{"socket":	5,"local_host":	"192.168.33.32","local_port":	46474,"remote_host":	"192.168.33.1","remote_port":	5201}],"version":	"iperf 3.7","system_info":	"Linux ubuntu 5.15.0-127-generic #137~20.04.1-Ubuntu SMP Fri Nov 15 14:46:54 UTC 2024 x86_64","timestamp":	{"time":	"Fri, 07 Mar 2025 09:09:26 GMT","timesecs":	1741338566},"connecting_to":	{"host":	"192.168.33.1","port":	5201},"cookie":	"xfmy6xsuautcobc7addl5htinbdys2ne4t5l","sock_bufsize":	0,"sndbuf_actual":	212992,"rcvbuf_actual":	212992,"test_start":	{"protocol":	"UDP","num_streams":	1,"blksize":	1448,"omit":	0,"duration":	10,"bytes":	0,"blocks":	0,"reverse":	0,"tos":	0}},"intervals":	[{"streams":	[{"socket":	5,"start":	0,"end":	1.000053,"seconds":	1.00005304813385,"bytes":	12489000,"bits_per_second":	99906700.135998666,"packets":	8625,"omitted":	false,"sender":	true}],"sum":	{"start":	0,"end":	1.000053,"seconds":	1.00005304813385,"bytes":	12489000,"bits_per_second":	99906700.135998666,"packets":	8625,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	1.000053,"end":	2.000048,"seconds":	0.99999499320983887,"bytes":	12506376,"bits_per_second":	100051508.93691055,"packets":	8637,"omitted":	false,"sender":	true}],"sum":	{"start":	1.000053,"end":	2.000048,"seconds":	0.99999499320983887,"bytes":	12506376,"bits_per_second":	100051508.93691055,"packets":	8637,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	2.000048,"end":	3.000007,"seconds":	0.99995899200439453,"bytes":	12494792,"bits_per_second":	99962435.259105816,"packets":	8629,"omitted":	false,"sender":	true}],"sum":	{"start":	2.000048,"end":	3.000007,"seconds":	0.99995899200439453,"bytes":	12494792,"bits_per_second":	99962435.259105816,"packets":	8629,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	3.000007,"end":	4.00001,"seconds":	1.0000029802322388,"bytes":	12502032,"bits_per_second":	100015957.92921779,"packets":	8634,"omitted":	false,"sender":	true}],"sum":	{"start":	3.000007,"end":	4.00001,"seconds":	1.0000029802322388,"bytes":	12502032,"bits_per_second":	100015957.92921779,"packets":	8634,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	4.00001,"end":	5.000007,"seconds":	0.99999701976776123,"bytes":	12500584,"bits_per_second":	100004970.03803575,"packets":	8633,"omitted":	false,"sender":	true}],"sum":	{"start":	4.00001,"end":	5.000007,"seconds":	0.99999701976776123,"bytes":	12500584,"bits_per_second":	100004970.03803575,"packets":	8633,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	5.000007,"end":	6.000171,"seconds":	1.0001640319824219,"bytes":	12503480,"bits_per_second":	100011434.92606422,"packets":	8635,"omitted":	false,"sender":	true}],"sum":	{"start":	5.000007,"end":	6.000171,"seconds":	1.0001640319824219,"bytes":	12503480,"bits_per_second":	100011434.92606422,"packets":	8635,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	6.000171,"end":	7.000442,"seconds":	1.0002709627151489,"bytes":	12503480,"bits_per_second":	100000743.52701701,"packets":	8635,"omitted":	false,"sender":	true}],"sum":	{"start":	6.000171,"end":	7.000442,"seconds":	1.0002709627151489,"bytes":	12503480,"bits_per_second":	100000743.52701701,"packets":	8635,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	7.000442,"end":	8.000018,"seconds":	0.99957597255706787,"bytes":	12490448,"bits_per_second":	99965972.315621212,"packets":	8626,"omitted":	false,"sender":	true}],"sum":	{"start":	7.000442,"end":	8.000018,"seconds":	0.99957597255706787,"bytes":	12490448,"bits_per_second":	99965972.315621212,"packets":	8626,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	8.000018,"end":	9.000039,"seconds":	1.0000209808349609,"bytes":	12502032,"bits_per_second":	100014157.61946523,"packets":	8634,"omitted":	false,"sender":	true}],"sum":	{"start":	8.000018,"end":	9.000039,"seconds":	1.0000209808349609,"bytes":	12502032,"bits_per_second":	100014157.61946523,"packets":	8634,"omitted":	false,"sender":	true}}, {"streams":	[{"socket":	5,"start":	9.000039,"end":	10.00081,"seconds":	1.0007710456848145,"bytes":	12503480,"bits_per_second":	99950773.387485713,"packets":	8635,"omitted":	false,"sender":	true}],"sum":	{"start":	9.000039,"end":	10.00081,"seconds":	1.0007710456848145,"bytes":	12503480,"bits_per_second":	99950773.387485713,"packets":	8635,"omitted":	false,"sender":	true}}],"end":	{"streams":	[{"udp":	{"socket":	5,"start":	0,"end":	10.00081,"seconds":	10.00081,"bytes":	124995704,"bits_per_second":	99988464.134405121,"jitter_ms":	0.27399999999999997,"lost_packets":	0,"packets":	86323,"lost_percent":	0,"out_of_order":	0,"sender":	true}}],"sum":	{"start":	0,"end":	10.00081,"seconds":	10.00081,"bytes":	124995704,"bits_per_second":	99988464.134405121,"jitter_ms":	0.27399999999999997,"lost_packets":	0,"packets":	86323,"lost_percent":	0,"sender":	true},"cpu_utilization_percent":	{"host_total":	26.108550002461911,"host_user":	0.18748343181817051,"host_system":	25.921066570643742,"remote_total":	5.867906,"remote_user":	0.42318,"remote_system":	5.44472}}
}

服务端输出示例:

Accepted connection from 192.168.33.32, port 47688
[  5] local 192.168.33.1 port 5201 connected to 192.168.33.32 port 46474
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  5]   0.00-1.00   sec  7.11 MBytes  59.6 Mbits/sec  0.234 ms  0/5148 (0%)
[  5]   1.00-2.00   sec  7.50 MBytes  62.9 Mbits/sec  0.197 ms  0/5429 (0%)
[  5]   2.00-3.00   sec  7.59 MBytes  63.7 Mbits/sec  0.267 ms  0/5495 (0%)
[  5]   3.00-4.00   sec  7.50 MBytes  62.9 Mbits/sec  0.209 ms  0/5428 (0%)
[  5]   4.00-5.00   sec  7.50 MBytes  62.9 Mbits/sec  0.242 ms  0/5429 (0%)
[  5]   5.00-6.00   sec  7.30 MBytes  61.2 Mbits/sec  0.230 ms  0/5284 (0%)
[  5]   6.00-7.00   sec  7.16 MBytes  60.1 Mbits/sec  0.191 ms  0/5185 (0%)
[  5]   7.00-8.00   sec  7.29 MBytes  61.2 Mbits/sec  0.396 ms  0/5279 (0%)
[  5]   8.00-9.00   sec  7.31 MBytes  61.3 Mbits/sec  0.332 ms  0/5294 (0%)
[  5]   9.00-10.00  sec  7.52 MBytes  63.1 Mbits/sec  0.237 ms  0/5446 (0%)
[  5]  10.00-11.00  sec  7.44 MBytes  62.4 Mbits/sec  0.157 ms  0/5390 (0%)
[  5]  11.00-12.00  sec  7.44 MBytes  62.4 Mbits/sec  0.222 ms  0/5388 (0%)
[  5]  12.00-13.00  sec  7.43 MBytes  62.4 Mbits/sec  0.195 ms  0/5383 (0%)
[  5]  13.00-14.00  sec  7.41 MBytes  62.2 Mbits/sec  0.271 ms  0/5368 (0%)
[  5]  14.00-15.00  sec  7.39 MBytes  62.0 Mbits/sec  0.274 ms  0/5352 (0%)
[  5]  15.00-16.00  sec  7.46 MBytes  62.6 Mbits/sec  0.233 ms  0/5403 (0%)
[  5]  16.00-16.12  sec   874 KBytes  61.3 Mbits/sec  0.274 ms  0/618 (0%)
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  5]   0.00-16.12  sec  0.00 Bytes  0.00 bits/sec  0.274 ms  0/86319 (0%)
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

解释说明

  • Jitter:抖动,指数据包到达时间的变化量,单位为毫秒(ms)。SUM 行的抖动是所有线程抖动情况的综合体现。
  • Lost/Total Datagrams:丢失的数据包数量与发送的总数据包数量的信息,格式为 “丢失数 / 总数 (丢失率)”。SUM 行显示所有线程的汇总丢包情况

相关文章:

Ubuntu系统下交叉编译iperf3

一、参考资料 Linux下iperf3移植到arm下测试100M网口-CSDN博客 Iperf3移植到ARM Linux及使用教程-CSDN博客 二、准备工作 1. 编译环境 宿主机&#xff1a;Ubuntu 20.04.6 LTSHost&#xff1a;ARM32位交叉编译器&#xff1a;arm-linux-gnueabihf-gcc-11.1.0 2. 设置交叉编…...

游戏引擎学习第243天:异步纹理下载

仓库 https://gitee.com/mrxiao_com/2d_game_6 https://gitee.com/mrxiao_com/2d_game_5 回顾并为今天设定阶段 目前的开发工作主要回到了图形渲染相关的部分。我们之前写了自己的软件渲染器&#xff0c;这个渲染器性能意外地好&#xff0c;甚至可以以相对不错的帧率运行过场…...

27、Session有什么重⼤BUG?微软提出了什么⽅法加以解决?

Session的重大BUG 1、进程回收导致Session丢失 原理&#xff1a; IIS的进程回收机制会在系统繁忙、达到特定内存阈值等情况下&#xff0c;自动回收工作进程&#xff08;w3wp.exe&#xff09;。由于Session数据默认存储在进程内存中&#xff0c;进程回收时这些数据会被清除。 …...

机器学习在网络安全中的应用:守护数字世界的防线

一、引言 随着信息技术的飞速发展&#xff0c;网络安全问题日益凸显&#xff0c;成为全球关注的焦点。传统的网络安全防护手段&#xff0c;如防火墙、入侵检测系统&#xff08;IDS&#xff09;和防病毒软件&#xff0c;虽然在一定程度上能够抵御攻击&#xff0c;但在面对复杂多…...

从数据到智慧:解密机器学习的自主学习密码

在数字洪流奔涌的时代&#xff0c;每一次点击、每一行代码、每一条传感器数据都在生成海量信息。传统编程如同精心设计的齿轮组&#xff0c;需要工程师逐行编写规则&#xff1b;而机器学习则打破这一范式&#xff0c;赋予机器从数据中自主提炼规律、总结模式的超能力。这种能力…...

Trae或者VsCode无法识别相对路径(不自动切换工作目录)

在VsCode中或者Trae中&#xff0c;只要是在vscode的基础上修改得到的编辑器&#xff0c;都默认没有勾选自动选择当前文件路径为工作路径&#xff0c;因此需要手动修改工作路径或者设置&#xff0c;否则无法识别相对路径&#xff0c;PyCharm中就不会出现这种问题。 解决方法&…...

解决VSCode每次SSH连接服务器时,都需要下载vscode-server

如下图所示&#xff0c;本地下载或者在服务器终端上运行wget指令获得vscode服务器包 注意&#xff0c;解压完成后&#xff0c;需要修改文件名为你本地vscode的commit ID...

架构-系统工程与信息系统基础

一、系统工程核心知识 1. 系统工程定义 本质&#xff1a;一种组织管理技术&#xff0c;从整体出发分析系统要素&#xff08;组成、结构、信息流、控制机制&#xff09;&#xff0c;追求“整体最优”&#xff0c;借助计算机实现规划、设计、管理、控制的优化。目标&#xff1a…...

矩阵运算和线性代数操作开源库

用于矩阵运算和线性代数操作常用的开源库推荐&#xff0c;涵盖不同编程语言和硬件平台&#xff1a; C/C 库 Eigen 特点&#xff1a;高性能的模板库&#xff0c;支持矩阵/向量运算、线性求解、特征值计算等&#xff0c;无需依赖外部BLAS/LAPACK。 官网&#xff1a;https://eig…...

无标注文本的行业划分(行业分类)算法 —— 无监督或自监督学习

对于无标注文本的行业划分&#xff08;行业分类&#xff09;&#xff0c;属于典型的无监督或自监督学习任务。以下是几种常见的算法方法及实现思路&#xff0c;适用于缺乏标注数据的场景&#xff1a; 一、基于关键词匹配的规则方法 核心思想&#xff1a;通过预定义的行业关键…...

电子病历高质量语料库构建方法与架构项目(计划篇)

电子病历(EMR)作为医疗信息化的重要产物,包含了丰富的医疗信息和临床知识,是辅助临床决策、药物挖掘和医学研究的重要资源。然而,电子病历数据具有非结构化、噪声大、专业性强等特点,如何构建高质量电子病历语料库成为医疗自然语言处理领域的核心挑战。本全计划将从项目背景…...

什么混合检索?在基于大模型的应用开发中,混合检索主要解决什么问题?

混合检索的定义 混合检索(Hybrid Retrieval)是一种结合多种检索技术优势的信息检索方法,旨在通过整合不同检索策略提升检索系统的准确性、召回率和适应性。其核心思想是将基于关键词的检索(如BM25、TF-IDF)与基于语义的检索(如向量检索、深度学习模型)相结合,以应对单…...

优化uniappx页面性能,处理页面滑动卡顿问题

问题&#xff1a;在页面遇到滑动特别卡的情况就是在页面使用了动态样式或者动态类&#xff0c;做切换的时候页面重新渲染导致页面滑动卡顿 解决&#xff1a;把动态样式和动态类做的样式切换改为通过获取元素修改样式属性值 循环修改样式示例 bannerList.forEach((_, index)…...

Yocto meta-toradex-security layer 创建独立数据分区

By Toradex 胡珊逢 简介 Toradex 为其产品使用的软件系统如 Linux 提供了诸多的安全功能&#xff0c;例如 Secure Boot、分区加密、OP-TEE 等&#xff0c;帮助用户应对安全合规。这些功能可以通过在 Yocto Project 中添加由 Toradex 开发的 meta-toradex-securitylayer 被轻松…...

uniapp 安卓离线本地打包,Android Studio生成apk包

第一步&#xff1a;HbuilderX生成本地资源包 下载最新的SDK 下载完后压缩下来是这样的 将HbuilderX生成的复制到这里&#xff0c;替换 Android Studio引入下载的最新文件里的HBuilder-Integrate-AS目录 好&#xff0c;接下来开始修改配置 把你的证书签名&#xff…...

C语言教程(十四):C 语言指针详解

一、指针的基本概念 指针是一个变量&#xff0c;其值为另一个变量的内存地址。简单来说&#xff0c;指针指向了内存中的某个位置&#xff0c;通过指针可以间接访问该位置存储的数据。指针的使用可以让程序更加高效地处理数据&#xff0c;特别是在处理数组、动态内存分配等方面。…...

2025年04月24日Github流行趋势

项目名称&#xff1a;markitdown 项目地址url&#xff1a;https://github.com/microsoft/markitdown项目语言&#xff1a;Python历史star数&#xff1a;53,351今日star数&#xff1a;822项目维护者&#xff1a;afourney, gagb, sugatoray, PetrAPConsulting, l-lumin项目简介&a…...

切割PDF使用python,库PyPDF2

使用 Python 将大型 PDF 文件分割成多个小文件 理解任务 将一个 170M 的 PDF 文件分割成多个 10M 左右的小文件。这在处理大型 PDF 文件时非常有用&#xff0c;例如&#xff1a; 减少单个文件的大小&#xff0c;方便传输或存储分别处理不同的文件部分提高 PDF 处理的效率 选…...

网络IP冲突的成因与解决方案

网络IP冲突的成因与解决方案 一、IP冲突的常见现象与危害二、IP冲突的常见原因三、6种实用解决方案四、预防IP冲突的4个最佳实践五、总结 前言 肝文不易&#xff0c;点个免费的赞和关注&#xff0c;有错误的地方请指出&#xff0c;看个人主页有惊喜。 作者&#xff1a;神的孩子…...

python版本得数独游戏

python版本得数独游戏 游戏说明&#xff1a; 游戏使用9x9数独棋盘&#xff0c;.表示可填写的空格 输入格式为行,列,数值&#xff08;如3,5,7表示第3行第5列填7&#xff09; 系统会自动检查以下内容&#xff1a; 输入格式是否正确 数字是否在1-9范围内 是否修改固定数字 是…...

64位系统上编译32位openh264 x264

在64位系统上要使用i386(32位库)的时候&#xff0c;有些是找不到apt可以安装的版本&#xff0c;所以需要手动编译安装&#xff0c;下面是openh264和x264的编译过程。 默认编译openh264 git clone https://github.com/cisco/openh264make ARCHi386 OSlinux PREFIX/lib/i386-li…...

加深对vector理解OJ题

17. 电话号码的字母组合 - 力扣&#xff08;LeetCode&#xff09; OJ&#xff08;一&#xff09;电话号码的字母组合 思路&#xff1a;这里以引用leetcode里面的一个大佬里面的图 1.这道题中&#xff0c;我们用递归的方法来写。 为了简洁展示&#xff0c;我们举例子”456“&am…...

协作开发攻略:Git全面使用指南 — 第三部分 特殊应用场景

协作开发攻略&#xff1a;Git全面使用指南 — 第三部分 特殊应用场景 Git 是一种分布式版本控制系统&#xff0c;用于跟踪文件和目录的变更。它能帮助开发者有效管理代码版本&#xff0c;支持多人协作开发&#xff0c;方便代码合并与冲突解决&#xff0c;广泛应用于软件开发领域…...

机器学习(9)——随机森林

文章目录 1. 随机森林的基本原理想2. 算法流程2.1. 数据采样&#xff08;Bootstrap&#xff09;&#xff1a;2.2. 构建决策树&#xff1a;2.3. 聚合预测&#xff1a; 3. 随机森林的构建过程3.1. 数据集的随机抽样3.2. 决策树的训练3.3. 树的生长3.4. 多棵树的集成3.5. 输出预测…...

(第三篇)Springcloud之Ribbon负载均衡

一、简介 1、介绍 Spring Cloud Ribbon是Netflix发布的开源项目&#xff0c;是基于Netflix Ribbon实现的一套客户端负载均衡的工具。主要功能是提供客户端的软件负载均衡算法&#xff0c;将Netflix的中间层服务连接在一起。Ribbon客户端组件提供一系列完善的配置项如连接超时&…...

Linux并发与竞争:从生活例子到内核实战

Linux并发与竞争&#xff1a;从生活例子到内核实战 一、并发与竞争&#xff1a;多车道公路的交通问题 想象一条四车道的高速公路&#xff08;多核CPU&#xff09;&#xff0c;所有车辆&#xff08;线程/进程&#xff09;都想通过同一个收费站&#xff08;共享资源&#xff09…...

【金仓数据库征文】——金仓数据库:国产数据库的卓越之选

目录 一、金仓数据库的核心技术优势 &#xff08;一&#xff09;强大的事务处理能力 &#xff08;二&#xff09;高度安全 &#xff08;三&#xff09;全面兼容与深度适配 &#xff08;四&#xff09;强大的扩展性 &#xff08;五&#xff09;智能便捷的工具 二、电信行…...

人脸识别考勤系统实现教程:基于Face-Recognition、OpenCV与SQLite

引言 随着人工智能技术的飞速发展&#xff0c;人脸识别技术已广泛应用于安防、金融、教育等多个领域。本文将带领大家利用Python的face-recognition库、OpenCV和SQLite数据库&#xff0c;从零开始构建一个具备异常报警功能的人脸识别考勤系统。该系统能够实时检测视频流中的人…...

Golang 闭包学习

引言 在平常的 Go 语言开发中&#xff0c;常常需要将一段函数逻辑封装起来&#xff0c;异步执行、作为回调传递&#xff0c;甚至保持某些运行时状态。此时&#xff0c;闭包成为一种非常自然的编程手段。它允许我们在函数内部“记住”外部作用域中的变量&#xff0c;从而实现变…...

Trae+DeepSeek学习Python开发MVC框架程序笔记(四):使用sqlite验收用户名和密码

继续通过Trae向DeepSeek发问并修改程序&#xff0c;实现程序运行时生成数据库&#xff0c;用户在系统登录页面输入用户名和密码后&#xff0c;控制器通过模型查询用户数据库表来验证用户名和密码&#xff0c;验证通过后显示登录成功页面&#xff0c;验证失败则显示登录失败页面…...

【mdlib】0 全面介绍 mdlib - Rust 实现的 Markdown 工具集

mdlib 是由开发者 bahdotsh 创建的一个多功能 Markdown 工具集合&#xff0c;包含两个主要组件&#xff1a;一个轻量级 Markdown 解析库和一个功能完善的个人 Wiki 系统。该项目完全采用 Rust 实现&#xff0c;兼具高性能与跨平台特性。 核心组件 Markdown 解析库 特性&#…...

使用Django REST Framework快速开发API接口

以下是使用 Django 和 Django REST Framework (DRF) 开发 API 接口的核心步骤&#xff0c;涵盖模型、迁移、序列化、视图、路由等关键环节&#xff1a; 前言 什么是DRF&#xff1f; Django REST Framework&#xff08;DRF&#xff09; 是基于Django的一个强大且灵活的工具包&…...

Vue3项目中 npm 依赖安装 --save 与 --save-dev 的区别解析

这两个命令的区别如下&#xff1a; bash npm install --save types/crypto-js # 安装到 dependencies&#xff08;生产依赖&#xff09; npm install --save-dev types/crypto-js # 安装到 devDependencies&#xff08;开发依赖&#xff09; 核心区别 依赖分类不同…...

开源模型应用落地-语音合成-MegaTTS3-零样本克隆与多语言生成的突破

一、前言 在人工智能技术飞速发展的今天,文本转语音(TTS)技术正以前所未有的速度改变着人机交互的方式。近日,字节跳动与浙江大学联合推出了一款名为MegaTTS3 的开源TTS模型,再次刷新了行业对高质量语音合成的认知。作为一款轻量化设计的模型,MegaTTS3以仅0.45亿参数 的规…...

connection.cursor() 与 models.objects.filter

在 Django 中操作数据库时&#xff0c;connection.cursor() 和 models.objects.filter 是两种不同的方式&#xff0c;各有特点和适用场景&#xff1a; models.objects.filter (ORM 方式) 特点‌&#xff1a; 基于 Django 的 ORM&#xff08;对象关系映射&#xff09;框架&am…...

深入浅出JavaScript常见设计模式:从原理到实战(1)

深入浅出JavaScript常见设计模式&#xff1a;从原理到实战(1) 设计模式是一种在特定情境下解决软件设计中常见问题的通用方案或模板。在特定的开发场景中使用特定的设计模式&#xff0c;可以提升代码质量&#xff0c;增强代码可读性和可维护性&#xff0c;提高团队开发效率&…...

RCE学习

一、远程代码执行漏洞 1. 远程代码执行的定义 定义&#xff1a;远程代码执行漏洞&#xff08;Remote Code Execute&#xff0c;简称RCE&#xff09;是指程序预留了执行命令或代码的接口并被黑客利用的漏洞。广义上也包括远程命令执行&#xff08;Remote Command Execute&…...

Redis安装及入门应用

应用资料&#xff1a;https://download.csdn.net/download/ly1h1/90685065 1.获取文件&#xff0c;并在该文件下执行cmd 2.输入redis-server-lucifer.exe redis.windows.conf&#xff0c;即可运行redis 3.安装redis客户端软件 4.安装后运行客户端软件&#xff0c;输入链接地址…...

【棒球运动】户外运动安全技巧·棒球1号位

以棒球运动为例&#xff0c;在棒球这项结合力量、速度与策略的户外运动中&#xff0c;安全防护是保障运动表现的核心。以下是针对棒球特点的户外安全指南&#xff0c;涵盖装备、环境与行为规范三大维度&#xff1a; 一、场景化防护装备选择 击球场景 击球手需佩戴双重防护头盔…...

卸载rpm包

昨天了解了查询rpm包的流程和命令,那么今天了解一下删除rpm包的语法,那么话不多说,来看. 1.基本语法 rpm -e RPM包的名称 注&#xff1a;e erase擦除 2.案例 删除firefox软件包 &#xff1a;rpm -e firefox 3.细节讨论 1.如果其它软件包依赖于要卸载的软件包,卸载时…...

【AI提示词】艺人顾问

提示说明 专业艺人顾问&#xff0c;专注于为客户提供全面的艺术、娱乐和商业咨询服务&#xff0c;帮助他们在竞争激烈的行业中树立品牌影响力&#xff0c;提升市场竞争力 提示词 # Role: 艺人顾问## Profile - language: 中文 - description: 专业艺人顾问&#xff0c;专注于…...

第七部分:向量数据库和索引策略

什么是矢量数据库&#xff1f; 简单来说&#xff0c;向量数据库是一种专门化的数据库&#xff0c;旨在优化存储和检索以高维向量形式表示的文本。 为什么这些数据库对RAG至关重要&#xff1f;因为向量表示能够在大规模文档库中进行高效的基于相似性的搜索&#xff0c;根据用户…...

26考研|数学分析:数项级数

数项级数这一章的开始&#xff0c;开启了新的关于“级数”这一新的概念体系的学习进程&#xff0c;此部分共包含四章的内容&#xff0c;分别为数项级数、函数项级数、幂级数以及傅里叶级数。这一章中&#xff0c;首先要掌握级数的相关概念与定义&#xff0c;重难点在于掌握判断…...

2025 年免费 Word 转 PDF 转换器有哪些?

我们列出了最好的 Word 到 PDF 转换器&#xff0c;以便轻松轻松地将 .doc 文件导出到 .pdf 而不会丢失原始格式。 尽管 Microsoft 365 包含一个 Word 版本&#xff0c;该版本可以将您正在处理的 .docx 文档无缝导出为 PDF 格式&#xff0c;但仍在使用旧版 Word 的人可能缺少此…...

【Spring Boot】深入解析:#{} 和 ${}

1.#{} 和 ${}的使用 1.1数据准备 1.1.1.MySQL数据准备 &#xff08;1&#xff09;创建数据库&#xff1a; CREATE DATABASE mybatis_study DEFAULT CHARACTER SET utf8mb4;&#xff08;2&#xff09;使用数据库 -- 使⽤数据数据 USE mybatis_study;&#xff08;3&#xff…...

SpringMVC知识体系

SpringMVC 知识体系 1. SpringMVC 基础 MVC 设计模式 Model: 模型层&#xff0c;处理业务逻辑View: 视图层&#xff0c;负责界面展示Controller: 控制层&#xff0c;处理请求并协调模型和视图 核心组件 DispatcherServlet: 前端控制器HandlerMapping: 处理器映射Controller: …...

如何将 PDF 中的文本提取为 JSON 格式

一些 PDF 文件是“带标签”的&#xff0c;意味着它们包含关于文件结构的信息。这种结构作为元数据嵌入在 PDF 中&#xff0c;由一系列标签组成&#xff0c;用于标记诸如标题、段落、列表、表格和图像等元素。 这非常类似于 HTML&#xff0c;其中的文本包含在具有语义意义的元素…...

深度解析:基于Python的微信小程序自动化操作实现

引言 在当今数字化时代&#xff0c;自动化技术正在改变我们与软件交互的方式。本文将深入解析一个使用Python实现的微信小程序自动化操作脚本&#xff0c;该脚本能够自动识别屏幕上的特定图像并执行点击操作。这种技术在自动化测试、批量操作和效率工具开发中有着广泛的应用前…...

【网络安全】网络钓鱼的类型

1. 网络钓鱼简介 网络钓鱼是最常见的社会工程学类型之一&#xff0c;它是一种利用人为错误来获取私人信息、访问权限或贵重物品的操纵技术。之前&#xff0c;您学习了网络钓鱼是如何利用数字通信诱骗人们泄露敏感数据或部署恶意软件的。 有时&#xff0c;网络钓鱼攻击会伪装成…...

Python----深度学习(基于深度学习Pytroch线性回归和曲线回归)

一、引言 在当今数据驱动的时代&#xff0c;深度学习已成为解决复杂问题的有力工具。它广泛应用于图像识别、自然语言处理和预测分析等领域。回归分析是统计学的一种基础方法&#xff0c;用于描述变量之间的关系。通过回归模型&#xff0c;我们可以预测连续的数值输出&#xf…...