实验环境:
vmware workstation 11
centos6.7的系统下
server端:192.168.239.140 防火墙关闭 setenforce 0
client端:192.168.239.138 防火墙关闭 setenforce 0
SecureCRT (ssh远程连接软件)
软件介绍:
qperf measures bandwidth and latency between two nodes. It can work over TCP/IP as well as
the RDMA transports. On one of the nodes, qperf is typically run with no arguments desig-
nating it the server node. One may then run qperf on a client node to obtain measurements
such as bandwidth, latency and cpu utilization.
In its most basic form, qperf is run on one node in server mode by invoking it with no argu-
ments. On the other node, it is run with two arguments: the name of the server node fol-
lowed by the name of the test. A list of tests can be found in the section, TESTS. A vari-
ety of options may also be specified.
软件的使用:
我们可以直接man一下qperf
NAME
qperf - Measure RDMA and IP performance
SYNOPSIS
qperf
qperf SERVERNODE [OPTIONS] TESTS
EXAMPLES 例子
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
当然简单的使用的话 还是比较容易上手的。
实验流程:
一、服务器端部署(记住防火墙先关闭)
1、qperf软件安装
[root@localhost ~]# yum install -y qperf
2、qperf软件启动
[root@localhost ~]# qperf
二、客户端部署(关闭防火墙)
1、qperf软件安装
[root@localhost ~]# yum install -y qperf
2、测量tcp的带宽和延时
[root@localhost ~]# qperf 192.168.239.140 tcp_bw tcp_lat
tcp_bw:
bw = 390 MB/sec
tcp_lat:
latency = 64.7 us
可以看到我的带宽是390MB 时延是64.7 us
3、测量tcp的带宽和延时、双方机器的配置
[root@localhost ~]# qperf 192.168.239.140 tcp_bw tcp_lat conf
tcp_bw:
bw = 389 MB/sec
tcp_lat:
latency = 61.7 us
conf:
loc_node = localhost.localdomain
loc_cpu = Intel Core i5-3230M @ 2.60GHz
loc_os = Linux 2.6.32-431.el6.x86_64
loc_qperf = 0.4.9
rem_node = localhost.localdomain
rem_cpu = Intel Core i5-3230M @ 2.60GHz
rem_os = Linux 2.6.32-431.el6.x86_64
rem_qperf = 0.4.9
4、我们可以透过改变消息的大小(msg_size),比如从1个字节到64K,每次倍增的方式,来观察带宽和延迟的变化情况
[root@localhost ~]# qperf 192.168.239.140 -oo msg_size:1:64K:*2 -vu tcp_lat
tcp_lat:
latency = 52 us
msg_size = 1 bytes
tcp_lat:
latency = 53.9 us
msg_size = 2 bytes
tcp_lat:
latency = 52.1 us
msg_size = 4 bytes
tcp_lat:
latency = 54.1 us
msg_size = 8 bytes
tcp_lat:
latency = 53.5 us
msg_size = 16 bytes
tcp_lat:
latency = 53.3 us
msg_size = 32 bytes
tcp_lat:
latency = 53.8 us
msg_size = 64 bytes
tcp_lat:
latency = 59.7 us
msg_size = 128 bytes
tcp_lat:
latency = 53.8 us
msg_size = 256 bytes
tcp_lat:
latency = 56.2 us
msg_size = 512 bytes
tcp_lat:
latency = 55.7 us
msg_size = 1 KiB (1,024)
tcp_lat:
latency = 88.9 us
msg_size = 2 KiB (2,048)
tcp_lat:
latency = 81.9 us
msg_size = 4 KiB (4,096)
tcp_lat:
latency = 102 us
msg_size = 8 KiB (8,192)
tcp_lat:
latency = 212 us
msg_size = 16 KiB (16,384)
tcp_lat:
latency = 278 us
msg_size = 32 KiB (32,768)
tcp_lat:
latency = 501 us
msg_size = 64 KiB (65,536)
我们可以清晰的看到随着消息的增大时延明显的增大 。
谢谢大家~~~~~~ 希望大家学有所得。
本文出自 “积少成多” 博客,谢绝转载!
原文地址:http://9399369.blog.51cto.com/9389369/1785359