@ljm
2017-12-28T21:01:07.000000Z
字数 1688
阅读 1217
experiment
最近这段时间对httperf做了些调研,故特此写下总结。
编译安装
$./configure
$make
$sudo make install
缺省安装在目录/usr/local/bin下
通过如下命令:
httperf --server xx.com --port 80 --uri /foreground/all_stars --rate 100 --num-conn 2000 --num-call 1 --timeout 5
rate是指每秒多少个连接数,num-conn指共发多少个连接 ,num-call每次连接发送的请求数通常为1
下面我们来试试新浪
httperf --server sina.com.cn --num-conn 300 --rate 30
每秒回应平均请求数为28.7
平均响应时间为 143.4毫秒
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
solution:
--wlog
选项实现访问多个uri的功能
demo:
httperf --server liujunming.top --num-conn 300 --rate 30 --wlog Y,wlog.log
autobench 是一款基于httperf的Perl脚本。它会在一次测试中调用多次httperf来对web服务器进行测试,每次会按照给定的参数增加并发连接数,将 httperf的测试结果保存为CSV格式的文件,该文件可以被Excel直接读取,方便生成测试报告。
下载安装文件
xenoclast
编译安装
make
sudo make install
缺省安装在目录/usr/local/bin下
autobench --single_host --host1 www.test.com --uri1 /10K --quiet --low_rate 20 --high_rate 200 --rate_step 20 --num_call 10 --num_conn 5000 --timeout 5 --file results.tsv
Will benchmark "http://www.test.com/10K", with a series of tests starting at 20 connections per second (with 10 requests per connection), and increasing by 20 connections per second until 200 connections a second are being requested. Each test will comprise a total of 5000 connections, and any responses which take longer than 5 seconds to arrive will be counted as errors. The results will be saved in the file 'results.tsv'.
参考资料:
1. mervine.net
2. cppblog
3. damithakumarage
4. linux.die.net
5. hpl.hp