温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

autobench快速入门

发布时间:2020-04-08 00:24:40 来源:网络 阅读:3198 作者:小强测试 栏目:软件技术

前言

我们经常会用loadrunner来做性能测试,但有时候loadrunner没法完成一些性能测试,这时候就需要其他工具了,今天就给大家介绍一个autobench。

简介

autobench 是一款基于httperf的Perl脚本。它会在一次测试中调用多次httperf来对web服务器进行测试,每次会按照给定的参数增加并发连接数,将httperf的测试结果保存为CSV格式的文件,该文件可以被Excel直接读取,方便生成测试报告。借助于autobench自带的bench3graph工具可以生成漂亮的测试结果对比图。

1、先安装Httperf 

下载:http://code.google.com/p/httperf/downloads/list

tar xvzf httperf-0.9.0.tar.gz

cd httperf-0.9.0

./configure

make && make install

2、安装gnuplot

下载:http://www.gnuplot.info/download.html

tar xvzf gnuplot-4.2.0.tar.gz

cd gnuplot-4.2.0

./configure

make && make install

cp /usr/local/bin/bench3graph /usr/local/bin/bench3png

sed -i 's/postscript color/png xffffff/g' /usr/local/bin/bench3png

注意这里一定要打开:echo set data style linespoints >> gnuplot.cmd

3、安装autobench

下载: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

4、使用

4.1 测试单台主机

./autobench \

    --single_host \

    --host1=your_ip \

    --port1=80 \

    --uri1=/home/www/mysql_con.php \

    --quiet \

    --low_rate=5 \

    --high_rate=100 \

    --rate_step=5 \

    --num_call=5 \

    --num_conn=1000 \

    --timeout=10 \

    --file /tmp/con_results.tsv

4.2 测试多台机器

./autobench \

    --host1=your_ip1 \

    --port1=80 \

    --uri1=/home/www/mysql_con.php \

    --host2=your_ip2 \

    --port2=80 \

    --uri2=/home/www/mysql_pcon.php \

    --quiet \

    --low_rate=5 \

    --high_rate=100 \

    --rate_step=5 \

    --num_call=5 \

    --num_conn=1000 \

    --timeout=10 \

    --file /tmp/results.tsv

4.3 参数含义

--signle_host 只测单机

--host1 测试主机地址

--uri1 host1 测试URI

--quiet 安静模式

--low_rate 测试时最低请求数(指 httperf)

--hight_rate 测试时最高请求数

--rate_step 每次测试请求数增加步长

--num-call 同httperf

--num_conn 同httperf

--file 测试结果输出的 tsv文件

4.4 生成图片

bench3png results.tsv results.png

autobench快速入门

5、参考文章

http://www.xenoclast.org/autobench/

http://www.xenoclast.org/autobench/man/autobench.html#index

 

http://blog.chinaunix.net/uid-20587912-id-405065.html

http://hi.baidu.com/malele2008/blog/item/48d63e547a96cf4fd0090681.html

http://html.conclase.net/cp/scripts/mod_block_worms/bench.html

http://zbylovecool.blog.51cto.com/2515860/658593

 

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI