apache ab是开源的轻量级压力测试工具,开发者可以使用该测试工具进行简单的压力测试工作。如下是该工具的参数详解:
如果服务器上安装了apache,那么就会自动安装了ab工具。如果没安装,可以通过httpd_tools源码进行安装。
进入到apache/bin目录,ab命令在该目录下,执行 ./ab -h 查看ab参数详解,如下:
[root@test bin]# ./ab -h
Usage: ./ab [options] [http://]hostname[:port]/path
Options are:
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make
-t timelimit Seconds to max. wait for responses
-b windowsize Size of TCP send/receive buffer, in bytes
-p postfile File containing data to POST. Remember also to set -T
-u putfile File containing data to PUT. Remember also to set -T
-T content-type Content-type header for POSTing, eg.
'application/x-www-form-urlencoded'
Default is 'text/plain'
-v verbosity How much troubleshooting info to print
-w Print out results in HTML tables
-i Use HEAD instead of GET
-x attributes String to insert as table attributes
-y attributes String to insert as tr attributes
-z attributes String to insert as td or th attributes
-C attribute Add cookie, eg. 'Apache=1234. (repeatable)
-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
are a colon separated username and password.
-P attribute Add Basic Proxy Authentication, the attributes
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
-d Do not show percentiles served table.
-S Do not show confidence estimators and warnings.
-g filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served
-r Don't exit on socket receive errors.
-h Display usage information (this message)
[root@test bin]#
中文介绍:
-n 执行的请求数
-c 并发请求数
-t 测试时执行时间
-b tcp缓冲区大小
-p 发送包含的post请求的header信息
-u 数据信息
-h ab命令帮助信息
北京整形医院:http://www.zjyestar.cn/