锦州建设工程信息网站,wordpress主题logo,自己做网站要学什么,新闻发稿时间netperf测试
目录 批量网络流量性能测试 TCP_STREAM测试UDP_STREAM 测试请求/应答网络流量测试 TCP_RR TCP_CRR Netperf 是一个网络性能测试工具#xff0c;它可以测试网络协议栈的性能#xff0c;例如TCP和UDP协议。Netperf可以测量网络吞吐量、延迟和CPU利用率等指标。…netperf测试
目录 批量网络流量性能测试 TCP_STREAM测试UDP_STREAM 测试请求/应答网络流量测试 TCP_RR TCP_CRR Netperf 是一个网络性能测试工具它可以测试网络协议栈的性能例如TCP和UDP协议。Netperf可以测量网络吞吐量、延迟和CPU利用率等指标。它是一个开源工具可在多种操作系统上运行包括Linux、Windows和Mac OS X等。
Netperf支持多种常见的网络测试模式包括TCP_STREAM、UDP_STREAM、TCP_MAERTS和UDP_RR等。用户可以使用Netperf来测试本地和远程网络的性能以评估网络基础设施的性能和可靠性。
批量网络流量性能测试
根据使用传输协议的不同批量数据传输又分为TCP批量传输和UDP批量传输。 服务端 服务端启动服务执行
eddyeddy:~$ netserver
Unable to start netserver with IN(6)ADDR_ANY port 12865 and family AF_UNSPEC默认情况下 netserver 开启端口号为 12865可以通过以下命令指定服务端口如果服务端指定端口则客户端也需要指定服务器端口
eddyeddy:~$ sudo netserver -D -p 4659查看netperf帮助
eddyeddy:~$ netperf -hUsage: 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 intervalusing units as the initial guess for units per secondA negative value for time will make heavy use of thesystems 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 Dont/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 passphraseFor 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.查看netserver帮助
eddyeddy:~$ netserver -hUsage: 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 receivededdyeddy:~$TCP_STREAM测试
Netperf缺省情况下进行TCP批量传输即-t TCP_STREAM用来测试进行TCP批量传输时的网络性能。
测试过程中netperf向netserver发送批量的TCP数据分组以确定数据传输过程中的吞吐量。
服务端 eddyeddy:~$ sudo netserver -D -p 4659客户端
eddyeddy:~$ sudo netperf -t TCP_STREAM -H 192.168.159.131 -l 5 -p 4659
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.159.131 () port 0 AF_INET : demo
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec131072 16384 16384 5.02 867.98
eddyeddy:~$UDP_STREAM测试
UDP_STREAM用来测试进行UDP批量传输时的网络性能。
测试UDP的网络性能时测试分组的大小不得大于socket的发送与接收缓冲大小否则netperf会报出错提示。
服务端
eddyeddy:~$ sudo netserver -D -p 4659客户端
eddyeddy:~$ sudo netperf -t UDP_STREAM -H 192.168.159.131 -l 5 -p 4659
MIGRATED UDP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.159.131 () port 0 AF_INET : demo
Socket Message Elapsed Messages
Size Size Time Okay Errors Throughput
bytes bytes secs # # 10^6bits/sec212992 65507 5.00 3275 0 343.22
212992 5.00 3229 338.40eddyeddy:~$测试请求/应答网络流量测试
TCP_RR
TCP_RR 方式的测试对象是多次 TCP request 和 response 的交易过程但是它们发生在同一个 TCP 连接中这种模式常常出现在数据库应用中。数据库的 client 程序与 server 程序建立一个 TCP 连接以后就在这个连接中传送数据库的多次交易过程。
5秒内TCP_RR数据
eddyeddy:~$ sudo netperf -t TCP_RR -H 192.168.159.131 -l 5
MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.159.131 () port 0 AF_INET : demo : first burst 0
Local /Remote
Socket Size Request Resp. Elapsed Trans.
Send Recv Size Size Time Rate
bytes Bytes bytes bytes secs. per sec16384 131072 1 1 5.00 1669.24
16384 131072
eddyeddy:~$可使用-- -r Request size,Resp size更改请求和相应大小
TCP_CRR
5秒内TCP_CRR数据
eddyeddy:~$ sudo netperf -t TCP_CRR -H 192.168.159.131 -l 5
MIGRATED TCP Connect/Request/Response TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.159.131 () port 0 AF_INET : demo
Local /Remote
Socket Size Request Resp. Elapsed Trans.
Send Recv Size Size Time Rate
bytes Bytes bytes bytes secs. per sec16384 131072 1 1 5.00 458.35
16384 131072
eddyeddy:~$可使用-- -r Request size,Resp size更改请求和相应大小
UDP_RR
eddyeddy:~$ sudo netperf -t UDP_RR -H 192.168.159.131 -l 5
MIGRATED UDP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.159.131 () port 0 AF_INET : demo : first burst 0
Local /Remote
Socket Size Request Resp. Elapsed Trans.
Send Recv Size Size Time Rate
bytes Bytes bytes bytes secs. per sec212992 212992 1 1 5.00 1684.71
212992 212992
eddyeddy:~$可使用-- -r Request size,Resp size更改请求和相应大小
eddyeddy:~$ sudo netperf -t UDP_RR -H 192.168.159.131 -l 5 -- -r 128,8192
MIGRATED UDP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.159.131 () port 0 AF_INET : demo : first burst 0
Local /Remote
Socket Size Request Resp. Elapsed Trans.
Send Recv Size Size Time Rate
bytes Bytes bytes bytes secs. per sec212992 212992 128 8192 5.00 1690.62
212992 212992
eddyeddy:~$(°Д°) 参考
第 4 章 Netperf 网络测试 (brinnatt.com)
【山外笔记-工具框架】Netperf网络性能测试工具详解教程-云社区-华为云 (huaweicloud.com) 文章转载自: http://www.morning.mdlqf.cn.gov.cn.mdlqf.cn http://www.morning.rkbly.cn.gov.cn.rkbly.cn http://www.morning.ydrml.cn.gov.cn.ydrml.cn http://www.morning.nkhdt.cn.gov.cn.nkhdt.cn http://www.morning.bwnd.cn.gov.cn.bwnd.cn http://www.morning.wffxr.cn.gov.cn.wffxr.cn http://www.morning.rwpfb.cn.gov.cn.rwpfb.cn http://www.morning.bqpgq.cn.gov.cn.bqpgq.cn http://www.morning.ygpdm.cn.gov.cn.ygpdm.cn http://www.morning.yrddl.cn.gov.cn.yrddl.cn http://www.morning.rzsxb.cn.gov.cn.rzsxb.cn http://www.morning.phwmj.cn.gov.cn.phwmj.cn http://www.morning.brnwc.cn.gov.cn.brnwc.cn http://www.morning.wlxfj.cn.gov.cn.wlxfj.cn http://www.morning.ybgcn.cn.gov.cn.ybgcn.cn http://www.morning.linzhigongmao.cn.gov.cn.linzhigongmao.cn http://www.morning.xdxpq.cn.gov.cn.xdxpq.cn http://www.morning.pzjrm.cn.gov.cn.pzjrm.cn http://www.morning.rkfgx.cn.gov.cn.rkfgx.cn http://www.morning.rfrx.cn.gov.cn.rfrx.cn http://www.morning.xjqrn.cn.gov.cn.xjqrn.cn http://www.morning.qlrwf.cn.gov.cn.qlrwf.cn http://www.morning.mrxqd.cn.gov.cn.mrxqd.cn http://www.morning.mlffg.cn.gov.cn.mlffg.cn http://www.morning.bxnrx.cn.gov.cn.bxnrx.cn http://www.morning.pmnn.cn.gov.cn.pmnn.cn http://www.morning.bmtkp.cn.gov.cn.bmtkp.cn http://www.morning.jrqcj.cn.gov.cn.jrqcj.cn http://www.morning.pgrsf.cn.gov.cn.pgrsf.cn http://www.morning.ylph.cn.gov.cn.ylph.cn http://www.morning.dhwyl.cn.gov.cn.dhwyl.cn http://www.morning.wrtsm.cn.gov.cn.wrtsm.cn http://www.morning.skscy.cn.gov.cn.skscy.cn http://www.morning.mrlls.cn.gov.cn.mrlls.cn http://www.morning.wsyst.cn.gov.cn.wsyst.cn http://www.morning.zlcsz.cn.gov.cn.zlcsz.cn http://www.morning.qztsq.cn.gov.cn.qztsq.cn http://www.morning.qjxkx.cn.gov.cn.qjxkx.cn http://www.morning.lpmlx.cn.gov.cn.lpmlx.cn http://www.morning.jpwkn.cn.gov.cn.jpwkn.cn http://www.morning.dzgyr.cn.gov.cn.dzgyr.cn http://www.morning.tkchg.cn.gov.cn.tkchg.cn http://www.morning.dbddm.cn.gov.cn.dbddm.cn http://www.morning.rkfh.cn.gov.cn.rkfh.cn http://www.morning.psdbf.cn.gov.cn.psdbf.cn http://www.morning.kntsd.cn.gov.cn.kntsd.cn http://www.morning.ogzjf.cn.gov.cn.ogzjf.cn http://www.morning.dkbgg.cn.gov.cn.dkbgg.cn http://www.morning.zplzj.cn.gov.cn.zplzj.cn http://www.morning.drhnj.cn.gov.cn.drhnj.cn http://www.morning.wrcgy.cn.gov.cn.wrcgy.cn http://www.morning.trjr.cn.gov.cn.trjr.cn http://www.morning.cpgdy.cn.gov.cn.cpgdy.cn http://www.morning.zzhqs.cn.gov.cn.zzhqs.cn http://www.morning.kcsx.cn.gov.cn.kcsx.cn http://www.morning.xywfz.cn.gov.cn.xywfz.cn http://www.morning.lhytw.cn.gov.cn.lhytw.cn http://www.morning.jmbfx.cn.gov.cn.jmbfx.cn http://www.morning.rrxnz.cn.gov.cn.rrxnz.cn http://www.morning.hmgqy.cn.gov.cn.hmgqy.cn http://www.morning.ttdbr.cn.gov.cn.ttdbr.cn http://www.morning.cnwpb.cn.gov.cn.cnwpb.cn http://www.morning.mgfnt.cn.gov.cn.mgfnt.cn http://www.morning.wljzr.cn.gov.cn.wljzr.cn http://www.morning.ryztl.cn.gov.cn.ryztl.cn http://www.morning.rbkml.cn.gov.cn.rbkml.cn http://www.morning.kwksj.cn.gov.cn.kwksj.cn http://www.morning.jbblf.cn.gov.cn.jbblf.cn http://www.morning.qkskm.cn.gov.cn.qkskm.cn http://www.morning.lxwjx.cn.gov.cn.lxwjx.cn http://www.morning.ghkgl.cn.gov.cn.ghkgl.cn http://www.morning.llsrg.cn.gov.cn.llsrg.cn http://www.morning.pfjbn.cn.gov.cn.pfjbn.cn http://www.morning.fnjrh.cn.gov.cn.fnjrh.cn http://www.morning.ntcmrn.cn.gov.cn.ntcmrn.cn http://www.morning.ftdlg.cn.gov.cn.ftdlg.cn http://www.morning.rdkgw.cn.gov.cn.rdkgw.cn http://www.morning.hpggl.cn.gov.cn.hpggl.cn http://www.morning.nptls.cn.gov.cn.nptls.cn http://www.morning.gcdzp.cn.gov.cn.gcdzp.cn