CentOS 8 netperf 安装与命令参数详解
在 CentOS 8 上通过 EPEL 安装 netperf 2.7.1(含 netserver)并逐参数实测吞吐/时延/CPU 命令输入与回显,涵盖 netserver 启动、-H/-l/-t(TCP_STREAM/UDP_STREAM/TCP_RR/UDP_RR)/-m/-s/-S/-p/-P/-c/-C/OMNI 及 EOL 仓库修复与联网/离线安装。
CentOS 8 netperf 安装与命令参数详解
目标:在 CentOS 8 上通过 EPEL 安装 netperf 2.7.1(包内含 netserver 服务端),并逐参数实测吞吐、时延与 CPU 统计命令的输入与输出,涵盖 netserver 启动、
-H/-l/-t(TCP_STREAM/UDP_STREAM/TCP_RR/UDP_RR)/-m/-s/-S/-p/-P/-c/-C/-t OMNI,以及 EOL 仓库修复、在线/离线安装。本文命令与输出均为 CentOS 8(netperf 2.7.1,RPMnetperf-2.7.0-1.20210803git3bc455b.el8.x86_64)实测回显。
一、环境信息
- 操作系统:CentOS Linux release 8.4.2105(已 EOL,仓库需切 vault/EPEL 镜像,见 3.1 前置)
- netperf / netserver 版本:2.7.1(二进制内部版本号;EPEL 包名
netperf-2.7.0-1.20210803git3bc455b.el8.x86_64) - 服务端主机:网卡 eth0,IP
172.25.0.4/16,MAC4a:ed:db:26:66:34,netserver 默认监听端口12865 - 客户端主机:同一
172.25.0.0/16网段,通过-H 172.25.0.4指定服务端发起压制 - 数据目录:
/opt/data/netperf/(离线 RPM 包存放目录) - 测试视角:服务端为 netserver 监听方,客户端为 netperf 发压方;el8 构建的 MIGRATED 头会多出
: histogram : interval : dirty data :特性标签(区别于 Ubuntu 版 2.7.0)
二、工具概述
netperf 是惠普实验室开发、覆盖 TCP / UDP / SCTP / DCCP 等协议的网络性能基准工具:netserver 做服务端监听、netperf 做客户端发压。可测吞吐(STREAM)、请求/应答时延(RR)、双向(DUPLEX)及 OMNI 结构化输出,用于量化「两台主机间吞吐上限、消息大小对吞吐影响、协议栈往返时延、CPU 开销」等。本文针对 CentOS 8 上的 2.7.1 实测——因 CentOS 8 已停止维护,官方 mirrorlist 不复存在,安装前需先将仓库切换到 vault 镜像并启用 EPEL(见 3.1)。
三、安装
3.1 前置:CentOS 8 EOL 仓库修复(必需)
CentOS 8 已 EOL(2021-12-31),默认 mirrorlist.centos.org 已不再解析,dnf makecache 直接失败:
dnf makecache
Errors during downloading metadata for repository 'appstream':
- Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=container [Could not resolve host: mirrorlist.centos.org]
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=container [Could not resolve host: mirrorlist.centos.org]
解决方案:删除旧 repo,改用阿里云 centos-vault 镜像(按当前小版本 8.4.2105 剪裁),关闭签名校验以便离线/镜像环境下直接使用:
rm -f /etc/yum.repos.d/CentOS-Linux-*.repo /etc/yum.repos.d/CentOS-Linux-Media.repo
cat > /etc/yum.repos.d/CentOS-Vault.repo <<'EOF'
[baseos]
name=CentOS Linux 8.4.2105 - BaseOS
baseurl=https://mirrors.aliyun.com/centos-vault/8.4.2105/BaseOS/x86_64/os/
gpgcheck=0
enabled=1
[appstream]
name=CentOS Linux 8.4.2105 - AppStream
baseurl=https://mirrors.aliyun.com/centos-vault/8.4.2105/AppStream/x86_64/os/
gpgcheck=0
enabled=1
[powertools]
name=CentOS Linux 8.4.2105 - PowerTools
baseurl=https://mirrors.aliyun.com/centos-vault/8.4.2105/PowerTools/x86_64/os/
gpgcheck=0
enabled=1
[extras]
name=CentOS Linux 8.4.2105 - Extras
baseurl=https://mirrors.aliyun.com/centos-vault/8.4.2105/extras/x86_64/os/
gpgcheck=0
enabled=1
EOF
dnf makecache
CentOS Linux 8.4.2105 - AppStream 346 kB/s | 9.6 MB 00:28
CentOS Linux 8.4.2105 - PowerTools 294 kB/s | 2.4 MB 00:08
CentOS Linux 8.4.2105 - Extras 13 kB/s | 10 kB 00:00
Metadata cache created.
💡 若你的 CentOS 8 小版本号不是 8.4.2105,把
baseurl里的8.4.2105换成实际小版本号(如8.5.2111)即可。
3.2 在线安装(dnf + EPEL)
netperf 不在 CentOS 8 基础仓库(BaseOS/AppStream/PowerTools/Extras)里,需先启用 EPEL:
cat > /etc/yum.repos.d/epel.repo <<'EOF'
[epel]
name=Extra Packages for Enterprise Linux $releasever - x86_64
baseurl=https://mirrors.aliyun.com/epel/8/Everything/x86_64/
gpgcheck=0
enabled=1
EOF
dnf install -y netperf
Total 279 kB/s | 775 kB 00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : lksctp-tools-1.0.18-3.el8.x86_64 1/2
Running scriptlet: lksctp-tools-1.0.18-3.el8.x86_64 1/2
Installing : netperf-2.7.0-1.20210803git3bc455b.el8.x86_64 2/2
Running scriptlet: netperf-2.7.0-1.20210803git3bc455b.el8.x86_64 2/2
Verifying : lksctp-tools-1.0.18-3.el8.x86_64 1/2
Verifying : netperf-2.7.0-1.20210803git3bc455b.el8.x86_64 2/2
Installed:
lksctp-tools-1.0.18-3.el8.x86_64
netperf-2.7.0-1.20210803git3bc455b.el8.x86_64
Complete!
💡 依赖
lksctp-tools(SCTP 协议库)会随 netperf 一并安装;该 el8 包二进制内部版本号是2.7.1(比 Ubuntu 的 2.7.0 新一个构建)。
安装后验证:
rpm -q netperf
netperf -V
netserver -V
netperf-2.7.0-1.20210803git3bc455b.el8.x86_64
Netperf version 2.7.1
Netperf version 2.7.1
3.3 离线安装(rpm 包)
在可联网的 CentOS 8 机器上,用 dnf download(需先装 dnf-plugins-core)把 netperf 及其依赖的 rpm 拉下来:
dnf install -y dnf-plugins-core
mkdir -p /opt/data/netperf
cd /opt/data/netperf
dnf download netperf lksctp-tools
(1/3): lksctp-tools-1.0.18-3.el8.x86_64.rpm 321 kB/s | 100 kB 00:00
(2/3): lksctp-tools-1.0.18-3.el8.i686.rpm 204 kB/s | 102 kB 00:00
(3/3): netperf-2.7.0-1.20210803git3bc455b.el8.x 258 kB/s | 676 kB 00:02
# 目录下生成
-rw-r--r-- 1 root root 101932 /opt/data/netperf/lksctp-tools-1.0.18-3.el8.x86_64.rpm
-rw-r--r-- 1 root root 691760 /opt/data/netperf/netperf-2.7.0-1.20210803git3bc455b.el8.x86_64.rpm
拷贝到离线机器并本地安装(实测先 dnf remove -y netperf 卸载再 rpm 装):
cd /opt/data/netperf
rpm -ivh lksctp-tools-1.0.18-3.el8.x86_64.rpm netperf-2.7.0-1.20210803git3bc455b.el8.x86_64.rpm
warning: lksctp-tools-1.0.18-3.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
warning: netperf-2.7.0-1.20210803git3bc455b.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 2f86d6a1: NOKEY
Verifying... ########################################
Preparing... ########################################
Updating / installing...
lksctp-tools-1.0.18-3.el8 ########################################
netperf-2.7.0-1.20210803git3bc455b.el8########################################
⚠️ 离线安装因未导入 EPEL GPG 密钥会有
Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY警告,属正常;NOKEY只是「未校验签名」,不影响安装完成。
四、命令实测
测试期间客户端、服务端均为 CentOS 8(netperf 2.7.1),netserver 在 172.25.0.4:12865 监听,客户端统一用 -H 172.25.0.4 指定服务端、-l 控制时长。各参数节中「输入=实测命令,输出=实测回显」。
4.1 启动服务端 netserver
用途:在「被测服务端」主机上启动 netserver,监听默认端口 12865。-D 为前台运行、不 daemon,便于观察启动回显。
netserver -p 12865 -D
Starting netserver with host 'IN(6)ADDR_ANY' port '12865' and family AF_UNSPEC
💡 netserver 默认端口为
12865;端口被占用会报Unable to start netserver with 'IN(6)ADDR_ANY' port '12865',用-p换端口即可(见 4.7)。
4.2 指定服务端 IP —— -H
用途:-H name|ip 指定被测服务端(netserver 所在机)。客户端最基础的压制就是「-H + 服务端 IP + 时长」。
netperf -H 172.25.0.4 -p 12865 -l 5
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.25.0.4 () port 0 AF_INET : histogram : interval : dirty data : demo
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
131072 16384 16384 5.00 11361.51
解读:默认执行 TCP 单向吞吐(TCP_STREAM)。131072 接收缓冲、16384 发送缓冲与消息大小;Elapsed Time 5.00 为时长;Throughput 11361.51 10^6bits/sec 约 11.36 Gbit/s。el8 构建的 MIGRATED 头多出 : histogram : interval : dirty data :,表示该二进制编译时开启了直方图/区间/脏数据特性(Ubuntu 2.7.0 无此标签)。
4.3 测试时长 —— -l
用途:-l testlen 指定测试时长(秒);>0 为秒数,<0 表示按字节数/事务数。到点输出统计并结束。
netperf -H 172.25.0.4 -p 12865 -l 4
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.25.0.4 () port 0 AF_INET : histogram : interval : dirty data : demo
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
131072 16384 16384 4.00 12006.73
解读:Elapsed Time 4.00 证明实测仅 4 秒。与 4.2 的 5 秒(11361.51)对照,短窗口结果波动明显;生产建议 -l 30 以上且多次取值。
4.4 测试类型 —— -t
用途:-t testname 选择测试类型;默认 TCP_STREAM。常用:TCP_STREAM / UDP_STREAM / TCP_RR / UDP_RR。
TCP_STREAM(TCP 单向吞吐,-t 可省):
netperf -H 172.25.0.4 -p 12865 -l 5 -t TCP_STREAM
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.25.0.4 () port 0 AF_INET : histogram : interval : dirty data : demo
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
131072 16384 16384 5.00 11361.51
UDP_STREAM(UDP 单向吞吐,含报文计数):
netperf -H 172.25.0.4 -p 12865 -l 5 -t UDP_STREAM
MIGRATED UDP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.25.0.4 () port 0 AF_INET : histogram : interval : dirty data : demo
Socket Message Elapsed Messages
Size Size Time Okay Errors Throughput
bytes bytes secs # # 10^6bits/sec
212992 65507 5.00 65079 0 6820.91
212992 5.00 63827 6689.69
解读:两行分别对应客户端发送(65079 报文、约 6.82 Gbit/s)与服务端接收(63827 报文、约 6.69 Gbit/s)视角。UDP 无重传语义,故报文计数能体现发送与接收是否对得上。本例无 enable_enobufs failed 警告(el8 构建比 Ubuntu 2.7.0 多链接了对应库)。
TCP_RR(TCP 请求/应答时延):
netperf -H 172.25.0.4 -p 12865 -l 5 -t TCP_RR
MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.25.0.4 () port 0 AF_INET : histogram : interval : dirty data : demo : first burst 0
Local /Remote
Socket Size Request Resp. Elapsed Trans.
Send Recv Size Size Time Rate
bytes Bytes bytes bytes secs. per sec
16384 131072 1 1 5.00 14137.32
16384 131072
解读:Request Size 1 + Resp. Size 1 为最小 1 字节请求/应答,Trans. Rate 14137.32 per seg(约 1.41 万次/秒)反映 TCP 小消息往返能力。
UDP_RR(UDP 请求/应答时延):
netperf -H 172.25.0.4 -p 12865 -l 5 -t UDP_RR
MIGRATED UDP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.25.0.4 () port 0 AF_INET : histogram : interval : dirty data : demo : first burst 0
Local /Remote
Socket Size Request Resp. Elapsed Trans.
Send Recv Size Size Time Rate
bytes Bytes bytes bytes secs. per sec
212992 212992 1 1 5.00 14138.85
212992 212992
解读:UDP 小包往返 14138.85 per sec;212992 为收发 socket 缓冲。
4.5 消息大小 —— -m
用途:-m size(测试参数,写在 -- 之后)设置每条消息字节数。TCP_STREAM 默认 16384;改小会拉低吞吐,用于观察「消息大小对吞吐的影响」。
netperf -H 172.25.0.4 -p 12865 -l 5 -t TCP_STREAM -- -m 2048
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.25.0.4 () port 0 AF_INET : histogram : interval : dirty data : demo
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
131072 16384 2048 5.00 1865.16
解读:Message Size 变为 2048,吞吐降至 1865.16 10^6bits/sec(约 1.87 Gbit/s)。小消息高频发包放大系统调用与协议开销,吞吐显著下降——这是量化业务「短包多还是大包少」的核心参数。
4.6 收发缓冲 —— -s / -S
用途:测试参数 -s size(本端发送缓冲)、-S size(对端发送缓冲)字节数,写在 -- 之后;帮助中全局 -s seconds 的语义是「开始前等待秒数」,两者含义不同、位置也不同。
netperf -H 172.25.0.4 -p 12865 -l 5 -t TCP_STREAM -- -s 65536 -S 65536
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.25.0.4 () port 0 AF_INET : histogram : interval : dirty data : demo
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
131072 131072 131072 5.00 22827.74
解读:收发缓冲显式放大到 131072(Message Size 跟随),吞吐提升到 22827.74 10^6bits/sec(约 22.83 Gbit/s)。缓冲越大、TCP 在途数据越多,高带宽时延积场景受益明显。
⚠️ 请把
-s/-S放在--(测试参数段)之后;放错位置会被当作全局的「等待秒数」。
4.7 端口 —— -p
用途:-p port 指定 netserver 端口与目标,支持 port,lport 双参(远端端口,本地源端口)。
先在服务端再起一个监听 12866 的 netserver:
netserver -p 12866 -D
Starting netserver with host 'IN(6)ADDR_ANY' port '12866' and family AF_UNSPEC
客户端连过去:
netperf -H 172.25.0.4 -p 12866 -l 4
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.25.0.4 () port 0 AF_INET : histogram : interval : dirty data : demo
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
131072 16384 16384 4.00 12325.04
4.8 结果字头开关 —— -P
用途:-P 0|1 控制是否显示测试头(header);-P 0 关闭两行 MIGRATED TCP STREAM TEST 字头,只留数据行,方便脚本解析。
netperf -H 172.25.0.4 -p 12865 -l 4 -P 0
131072 16384 16384 4.00 12006.73
解读:MIGRATED TCP STREAM TEST 字头被隐藏,仅剩数据区(Socket/Message/Elapsed/Throughput 行),适合接入性能回归脚本。
4.9 CPU 统计 —— -c / -C
用途:-c 报告本地(客户端)CPU、-C 报告远端(服务端)CPU 利用率;配合 RR 测试可评估每次事务的 CPU 微秒开销。
netperf -H 172.25.0.4 -p 12865 -l 5 -t TCP_RR -c -C
MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.25.0.4 () port 0 AF_INET : histogram : interval : dirty data : demo : first burst 0
Local /Remote
Socket Size Request Resp. Elapsed Trans. CPU CPU S.dem S.dem
Send Recv Size Size Time Rate local remote local remote
bytes bytes bytes bytes secs. per sec % S % S us/Tr us/Tr
16384 131072 1 1 5.00 57125.48 84.65 84.65 88.910 88.910
16384 131072
解读:追加 CPU local/CPU remote(各 84.65%)与 S.dem local/S.dem remote(各 88.910 us/Tr)四列。本机 1 字节互锤把两端单核打满约 85%,每次事务各耗约 89 微秒 CPU——小消息场景下易以 CPU 为瓶颈。
4.10 OMNI 结构化输出 —— -t OMNI
用途:-t OMNI 启用「通用/结构化」输出形态,可经 -O/-o 自选输出列与单位;-- -H <ip> -p <port> 内 -H/-p 指向对端与端口。
netperf -H 172.25.0.4 -p 12865 -t OMNI -- -H 172.25.0.4 -p 12865 -l 5
OMNI Send TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.25.0.4 () port 0 AF_INET : histogram : interval : dirty data : demo
Local Remote Local Elapsed Throughput Throughput
Send Socket Recv Socket Send Time Units
Size Size Size (sec)
Final Final
4194304 6291456 16384 10.00 12338.26 10^6bits/s
解读:OMNI 布局展示 Local Send Socket(4194304)、Remote Recv Socket(6291456)、Local Send Size(16384)、Elapsed (sec)(10.00)、Throughput(12338.26)与 Units(10^6bits/s)。-t OMNI 默认 10 秒窗口(-l 5 可再覆盖),是产出机器可读报表的推荐形态。
五、帮助输出
5.1 netperf -h(帮助全文,CentOS 8 / el8 版 2.7.1)
Usage: netperf [global options] -- [test options]
Global options:
-a send,recv Set the local send,recv buffer alignment
-A send,recv Set the remote send,recv buffer alignment
-B brandstr Specify a string to be emitted with brief output
-c [cpu_rate] Report local CPU usage
-C [cpu_rate] Report remote CPU usage
-d Increase debugging output
-D time,[units] * Display interim results at least every time interval
using units as the initial guess for units per second
A negative value for time will make heavy use of the
system's timestamping functionality
-f G|M|K|g|m|k Set the output units
-F lfill[,rfill]* Pre-fill buffers with data from specified file
-h Display this text
-H name|ip,fam * Specify the target machine and/or local ip and family
-i max,min Specify the max and min number of iterations (15,1)
-I lvl[,intvl] Specify confidence level (95 or 99) (99)
and confidence interval in percentage (10)
-j Keep additional timing statistics
-l testlen Specify test duration (>0 secs) (<0 bytes|trans)
-L name|ip,fam * Specify the local ip|name and address family
-o send,recv Set the local send,recv buffer offsets
-O send,recv Set the remote send,recv buffer offset
-n numcpu Set the number of processors for CPU util
-N Establish no control connection, do 'send' side only
-p port,lport* Specify netserver port number and/or local port
-P 0|1 Don't/Do display test headers
-r Allow confidence to be hit on result only
-s seconds Wait seconds between test setup and test start
-S Set SO_KEEPALIVE on the data connection
-t testname Specify test to perform
-T lcpu,rcpu Request netperf/netserver be bound to local/remote cpu
-v verbosity Specify the verbosity level
-W send,recv Set the number of send,recv buffers
-v level Set the verbosity level (default 1, min 0)
-V Display the netperf version and exit
-y local,remote Set the socket priority
-Y local,remote Set the IP_TOS. Use hexadecimal.
-Z passphrase Set and pass to netserver a passphrase
For those options taking two parms, at least one must be specified;
specifying one value without a comma will set both parms to that
value, specifying a value with a leading comma will set just the second
parm, a value with a trailing comma will set just the first. To set
each parm to unique values, specify both and separate them with a
comma.
* For these options taking two parms, specifying one value with no comma
will only set the first parms and will leave the second at the default
value. To set the second value it must be preceded with a comma or be a
comma-separated pair. This is to retain previous netperf behaviour.
💡 2.7.1 帮助全文与 Ubuntu 2.7.0 完全一致(含
-s全局语义 = 等待秒数、-v重复两行的原样输出);差异只在 MIGRATED 头部特性标签与二进制版本号。
5.2 netserver -h(帮助全文)
Usage: netserver [options]
Options:
-h Display this text
-D Do not daemonize
-d Increase debugging output
-f Do not spawn chilren for each test, run serially
-L name,family Use name to pick listen address and family for family
-N No debugging output, even if netperf asks
-p portnum Listen for connect requests on portnum.
-4 Do IPv4
-6 Do IPv6
-v verbosity Specify the verbosity level
-V Display version information and exit
-Z passphrase Expect passphrase as the first thing received
5.3 版本查询
netperf -V
netserver -V
rpm -q netperf
Netperf version 2.7.1
Netperf version 2.7.1
netperf-2.7.0-1.20210803git3bc455b.el8.x86_64
💡
netserver -V输出的同样是Netperf version 2.7.1(两端同源码、共享版本号);包管理器侧 RPM 名为2.7.0-1.20210803git3bc455b.el8(含发行/构建号)。
六、常见问题
6.1 CentOS 8 dnf 报 Couldn't resolve host name / 无法下载元数据
Q:dnf makecache 报 Couldn't resolve host name for http://mirrorlist.centos.org/?
A:CentOS 8 已 EOL,mirrorlist.centos.org 不再解析。按 3.1 把 repo 源切到阿里云 centos-vault 镜像(baseurl 中的小版本号换成实际版本)后 dnf makecache 即可。
6.2 netperf 不在仓库 / No match for argument: netperf
Q:dnf install -y netperf 报 No match for argument: netperf?
A:netperf 不在 CentOS 8 基础仓库。先启用 EPEL(见 3.2 的 epel.repo,指向 mirrors.aliyun.com/epel/8),再 dnf install -y netperf。
6.3 离线安装出现 Header NOKEY 警告
Q:rpm -ivh 输出 Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY?
A:离线环境未导入 EPEL GPG 公钥,rpm 无法验签故报 NOKEY。这是「未校验签名」的非致命警告,安装正常完成;如需消除可导入对应公钥或保持 gpgcheck=0 的仓库配置。
6.4 客户端连不上/吞吐波动大
Q:客户端连接失败,或吞吐波动大?
A:连接侧:核对服务端 netperf -p 端口与客户端 -p 一致、-H IP 正确、防火墙放行 12865,先用 nc -vz <ip> 12865 验证。吞吐侧:单流有上限可多 TCP 流逼近,-m/收发缓冲太小会压吞吐,-c -C 可看是否 CPU 饱和;生产取数建议 -l 30 以上多取中位值。
七、参考链接
- netperf 官方站点:https://hewlettpackard.github.io/netperf/
- netperf 源码与文档仓库:https://github.com/HewlettPackard/netperf/
- Fedora EPEL 包页:https://src.fedoraproject.org/rpms/netperf
- 阿里云 CentOS Vault 镜像:https://mirrors.aliyun.com/centos-vault/
- man 手册页:netperf(1)、netserver(1)(随软件包安装)
- 本文素材来源:CentOS 8(netperf 2.7.1 / el8)双机实测采集