[关闭]
@ljm 2017-12-28T13:01:07.000000Z 字数 1688 阅读 1137

httperf调研

experiment


最近这段时间对httperf做了些调研,故特此写下总结。

install

下载地址

缺省安装在目录/usr/local/bin下

usage

通过如下命令:
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:

多个uri访问

--wlog 选项实现访问多个uri的功能
demo:
httperf --server liujunming.top --num-conn 300 --rate 30 --wlog Y,wlog.log

autobench的使用

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

autobench安装

缺省安装在目录/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

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注