ab压测工具使用笔记

参数说明

Options are:
    -n requests     Number of requests to perform                (要执行的请求总数;默认1)
    -c concurrency  Number of multiple requests to make at a time      (并发数:同一时间发出的请求数量,;默认1)
    -t timelimit    Seconds to max. to spend on benchmarking         (用于基准测试的最长秒数.意味着设置-n 50000。)
                    This implies -n 50000
    -s timeout      Seconds to max. wait for each response          (每个响应最大等待秒数;默认为30秒)
                    Default is 30 seconds
    -b windowsize   Size of TCP send/receive buffer, in bytes        (发送和接收的buffer大小,单位是 bytes)
    -B address      Address to bind to when making outgoing connections  (建立传出连接时要绑定的地址)
    -p postfile     File containing data to POST. Remember also to set -T (post请求的参数数据文件。记住还要设置-T)
    -u putfile      File containing data to PUT. Remember also to set -T (put请求的参数数据文件。记住还要设置-T)
    -T content-type Content-type header to use for POST/PUT data, eg.   (设置请求头中的Content-type;默认为'text/plain' )
                    'application/x-www-form-urlencoded'
                    Default is 'text/plain'
    -v verbosity    How much troubleshooting info to print          (设置输出等级, 4 输出头信息,3 输出响应码(404,200) 2 输出警告和信息)
    -w              Print out results in HTML tables              (出结果到html里的table,默认两列,白色背景-i              Use HEAD instead of GET                   (get请求中使用head信息)
    -x attributes   String to insert as table attributes           (设置<table>属性的字符串)
    -y attributes   String to insert as tr attributes             (设置<tr>属性的字符串)
    -z attributes   String to insert as td or th attributes         (设置<td>属性的字符串)
    -C attribute    Add cookie, eg. 'Apache=1234'. (repeatable)       (添加Cookie)
    -H attribute    Add Arbitrary header line, eg. 'Accept-Encoding: gzip'(添加请求头)
                    Inserted after all normal header lines. (repeatable)
    -A attribute    Add Basic WWW Authentication, the attributes      (对服务器提供BASIC认证信任。用户名和密码由一个:隔开,并以base64编码形式发送。无论服务器是否需要,此字符串都会被发送)
                    are a colon separated username and password.
    -P attribute    Add Basic Proxy Authentication, the attributes     (对一个中转代理提供BASIC认证信任。用户名和密码由一个:隔开,并以base64编码形式发送。无论服务器是否需要(即, 是否发送了401认证需求代码),此字符串都会被发送)
                    are a colon separated username and password.
    -X proxy:port   Proxyserver and port number to use            (对请求使用代理服务器)
    -V              Print version number and exit               (显示版本号并退出)
    -k              Use HTTP KeepAlive feature                 (启用HTTP KeepAlive功能,即在一个HTTP会话中执行多个请求。默认时,不启用KeepAlive功能。)
    -d              Do not show percentiles served table.          (不显示"percentage served within XX [ms] table"的消息(为以前的版本提供支持))
    -S              Do not show confidence estimators and warnings.
    -q              Do not show progress when doing more than 150 requests(如果处理的请求数大于150,ab每处理大约10%或者100个请求时,会在stderr输出一个进度计数。此-q标记可以抑制这些信息。)
    -l              Accept variable document length (use this for dynamic pages)(接受可变的文档长度(用于动态页面))
    -g filename     Output collected data to gnuplot format file.    (把所有测试结果写入一个'gnuplot'或者TSV(以Tab分隔的)文件。此文件可以方便地导入到Gnuplot,IDL,Mathematica,Igor甚至Excel中。其中的第一行为标题。)
    -e filename     Output CSV file with percentages served        (产生一个以逗号分隔的(CSV)文件,其中包含了处理每个相应百分比的请求所需要(从1%到100%)的相应百分比的(以微妙为单位)时间。由于这种格式已经“二进制化”,所以比'gnuplot'格式更有用。)
    -r              Don't exit on socket receive errors.          (套接字接收错误时不退出)
    -m method       Method name                         (应该是用于设置请求类型)
    -h              Display usage information (this message)        (显示使用方法/帮助信息。)

 

返回说明

待补充

使用示例

posted @ 2020-11-16 18:35  黑键  阅读(177)  评论(0)    收藏  举报