网络性能工具——Netperf

举报
Neutronium_Hamster 发表于 2023/01/04 11:43:19 2023/01/04
【摘要】 记录自己安装网络性能工具——Netperf过程

测试环境:

CPU:Kunpeng 920 8Core
MEM:16G
Storage:200G
OS:openEuler 20.03 (LTS-SP3)

1 服务器资源监控工具——Netperf

1.1 编译安装——Netperf

  1. 源码编译安装

​ 下载源码:

wget https://github.com/HewlettPackard/netperf/archive/netperf-2.7.0.tar.gz

​ 解压进入目录:

tar -zxvf netperf-2.7.0.tar.gz
cd netperf-netperf-2.7.0/

​ 修改配置文件:

vi config.sub

#查找“x86”内容的位置,在其位置后面增加“aarch64”类型。在“case $basic_machine in”区域的两个位置修改。
1| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
修改为:
| x86 | aarch64 | xscale | xscalee[bl] | xstormy16 | xtensa \

2| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
修改为:
| x86-* | aarch64-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \

​ 生成Makefile:

./configure --host=aarch64 --build=aarch64

​ 编译安装:

make && make install

1.2 验证与运行——Netperf

  1. 执行如下命令,查看Netperf版本
netperf -V

​ 返回内容如下所示,表示安装已经完成:

[root@controller netperf-netperf-2.7.0]# netperf -V
Netperf version 2.7.0
  1. 运行

​ 在服务端运行指令:

netserver

​ 回显结果如下:

[root@controller netperf-netperf-2.7.0]# netserver
Starting netserver with host 'IN(6)ADDR_ANY' port '12865' and family AF_UNSPEC

​ 在客户端运行指令:

netperf-H host -l testlen -t testname

​ 其中参数说明如下:

-H host :指定远端运行netserver的server IP地址。
-l testlen:指定测试的时间长度(秒)
-t testname:指定进行的测试类型,包括TCP_STREAM,UDP_STREAM,TCP_RR,TCP_CRR,UDP_RR

​ 运行客户端指令示例:

netperf -H xxx.xxx.xxx.xxx -l 60

​ 回显结果如下:

[root@controller netperf-netperf-2.7.0]# netperf -H xxx.xxx.xxx.xxx -l 60
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to xxx.xxx.xxx.xxx () port 0 AF_INET
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

131072  16384  16384    60.00    40516.99

​ 结果内容说明如下:

1)远端系统(即server)使用大小为131072字节的socket接收缓冲;
2)本地系统(即client)使用大小为16384字节的socket发送缓冲;
3)向远端系统发送的测试分组大小为16384字节;
4)测试经历的时间为60秒。
5)吞吐量的测试结果为40516.99*10^6bits/秒。

​ 在缺省情况下,netperf向发送的测试分组大小设置为本地系统所使用的socket发送缓冲大小。

1.3 其他——Netperf

  1. Netperf源码仓库
https://github.com/HewlettPackard/netperf
  1. Netperf文档
https://github.com/HewlettPackard/netperf/tree/master/doc
  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.
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。