运维工具之qperf
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了运维工具之qperf相关的知识,希望对你有一定的参考价值。
qperf一种测试两个节点之间的带宽和延迟的一款工具。它可以工作在TCP/IP或者是RDMA之上。通常,一台作为服务器端只要开启qperf就可以,另一台作为客户端,在客户端进行带宽、延迟、CPU利用率等信息的测试。
通过命令我们可以看到除了tcp、udp外,还可以测试rdma, udp, sctp等网络协议的带宽和延迟
# qperf --help tests Miscellaneous conf Show configuration quit Cause the server to quit Socket Based rds_bw RDS streaming one way bandwidth rds_lat RDS one way latency sctp_bw SCTP streaming one way bandwidth sctp_lat SCTP one way latency sdp_bw SDP streaming one way bandwidth sdp_lat SDP one way latency tcp_bw TCP streaming one way bandwidth tcp_lat TCP one way latency udp_bw UDP streaming one way bandwidth udp_lat UDP one way latency RDMA Send/Receive rc_bi_bw RC streaming two way bandwidth rc_bw RC streaming one way bandwidth rc_lat RC one way latency uc_bi_bw UC streaming two way bandwidth uc_bw UC streaming one way bandwidth uc_lat UC one way latency ud_bi_bw UD streaming two way bandwidth ud_bw UD streaming one way bandwidth ud_lat UD one way latency xrc_bi_bw XRC streaming two way bandwidth xrc_bw XRC streaming one way bandwidth xrc_lat XRC one way latency RDMA rc_rdma_read_bw RC RDMA read streaming one way bandwidth rc_rdma_read_lat RC RDMA read one way latency rc_rdma_write_bw RC RDMA write streaming one way bandwidth rc_rdma_write_lat RC RDMA write one way latency rc_rdma_write_poll_lat RC RDMA write one way polling latency uc_rdma_write_bw UC RDMA write streaming one way bandwidth uc_rdma_write_lat UC RDMA write one way latency uc_rdma_write_poll_lat UC RDMA write one way polling latency InfiniBand Atomics rc_compare_swap_mr RC compare and swap messaging rate rc_fetch_add_mr RC fetch and add messaging rate Verification ver_rc_compare_swap Verify RC compare and swap ver_rc_fetch_add Verify RC fetch and add
接下来我们看一下qperf提供的一些例子,myserver就只作为服务器端节点的IP
# qperf --help examples In these examples, we first run qperf on a node called myserver in server mode by invoking it with no arguments. In all the subsequent examples, we run qperf on another node and connect to the server which we assume has a hostname of myserver. * To run a TCP bandwidth and latency test: qperf myserver tcp_bw tcp_lat * To run a SDP bandwidth test for 10 seconds: qperf myserver -t 10 sdp_bw * To run a UDP latency test and then cause the server to terminate: qperf myserver udp_lat quit * To measure the RDMA UD latency and bandwidth: qperf myserver ud_lat ud_bw * To measure RDMA UC bi-directional bandwidth: qperf myserver rc_bi_bw * To get a range of TCP latencies with a message size from 1 to 64K qperf myserver -oo msg_size:1:64K:*2 -vu tcp_lat
通过上面的例子我们要熟悉一些参数:
-t 这个参数指定测试维持的时间长度
-oo 通过man查看它的用法是"-oo Var:Init:Last:Incr" Var就是参数,Init就是初始值,Last就只最大值,Incr就是增长数,*2意思是两倍增长,2则是每次加上2字节。
本文出自 “集大成者,美若天成” 博客,请务必保留此出处http://kidjang.blog.51cto.com/9975340/1874645
以上是关于运维工具之qperf的主要内容,如果未能解决你的问题,请参考以下文章