首先安装Httperf。主要是Httperf网路上给出的url均无法访问,因此在GitHub上找的源码工程,进行安装。
接下来介绍安装步骤,从Github下载下来的httperf包是zip。
unzip httperf-master.zip
cd httperf-master
autoreconf -i (可能要首先安装一下autoconf sudo apt-get install autoconf )
生成configure文件之后
./configure
make && make install
至此httperf安装完成 cd到/usr/local/bin下有httperf可执行文件
测试一下:httperf --server 127.0.0.1 --port 8081 --num-conns 200 --timeout 5 --uri /getServerIp
测试结果:
httperf --timeout=5 --client=0/1 --server=127.0.0.1 --port=8081 --uri=/getServerIp --send-buffer=4096 --recv-buffer=16384 --ssl-protocol=auto --num-conns=200 --num-calls=1
Maximum connect burst length: 1
Total: connections 200 requests 200 replies 200 test-duration 17.702 s
Connection rate: 11.3 conn/s (88.5 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 63.5 avg 88.5 max 1066.1 median 76.5 stddev 81.0
Connection time [ms]: connect 42.4
Connection length [replies/conn]: 1.000Request rate: 11.3 req/s (88.5 ms/req)
Request size [B]: 79.0Reply rate [replies/s]: min 9.8 avg 11.1 max 13.4 stddev 2.0 (3 samples)
Reply time [ms]: response 46.1 transfer 0.0
Reply size [B]: header 160.0 content 19.0 footer 0.0 (total 179.0)
Reply status: 1xx=0 2xx=200 3xx=0 4xx=0 5xx=0CPU time [s]: user 11.92 system 5.48 (user 67.3% system 31.0% total 98.3%)
Net I/O: 2.8 KB/s (0.0*10^6 bps)Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
接下来安装AutoBench,这个相对来说好安装,直接wget下载安装即可。
- 下载: wget http://www.xenoclast.org/autobench/downloads/autobench-2.1.2.tar.gz
- 解压 : tar xvzf autobench-2.1.2.tar.gz
- cd autobench-2.1.2
- 编译 make
- 安装 make install
测试一下:autobench --single_host --host1=127.0.0.1 --port1=8081 --uri1=/getServerIp --quiet --low_rate=20 --high_rate=200 --rate_step=20 --num_call=5 --num_conn=500 --timeout=5 --file ./results.tsv
测试结果存放在result.tsv文件中,至此安装并测试完成。