ab ApacheBench web测试工具
2016-06-13 21:15
573 查看
http://www.ibm.com/developerworks/cn/linux/l-cn-ulimit/ ApacheBench参数说明 格式:ab[options][http://]hostname[:port]/path 参数说明: -nrequestsNumberofrequeststoperform //在测试会话中所执行的请求个数(本次测试总共要访问页面的次数)。默认时,仅执行一个请求。 -cconcurrencyNumberofmultiplerequeststomake //一次产生的请求个数(并发数)。默认是一次一个。 -ttimelimitSecondstomax.waitforresponses //测试所进行的最大秒数。其内部隐含值是-n50000。它可以使对服务器的测试限制在一个固定的总时间以内。默认时,没有时间限制。 -ppostfileFilecontainingdatatoPOST //包含了需要POST的数据的文件,文件格式如“p1=1&p2=2”.使用方法是-p111.txt。(配合-T) -Tcontent-typeContent-typeheaderforPOSTing //POST数据所使用的Content-type头信息,如-T“application/x-www-form-urlencoded”。(配合-p) -vverbosityHowmuchtroubleshootinginfotoprint //设置显示信息的详细程度–4或更大值会显示头信息,3或更大值可以显示响应代码(404,200等),2或更大值可以显示警告和其他信息。-V显示版本号并退出。 -wPrintoutresultsinHTMLtables //以HTML表的格式输出结果。默认时,它是白色背景的两列宽度的一张表。 -iUseHEADinsteadofGET //执行HEAD请求,而不是GET。 -xattributesStringtoinsertastableattributes -yattributesStringtoinsertastrattributes -zattributesStringtoinsertastdorthattributes -CattributeAddcookie,eg.-C“c1=1234,c2=2,c3=3”(repeatable) //-Ccookie-name=value对请求附加一个Cookie:行。其典型形式是name=value的一个参数对。此参数可以重复,用逗号分割。 提示:可以借助session实现原理传递JSESSIONID参数,实现保持会话的功能,如 -C”c1=1234,c2=2,c3=3,JSESSIONID=FF056CD16DA9D71CB131C1D56F0319F8″。 -HattributeAddArbitraryheaderline,eg.‘Accept-Encoding:gzip’Insertedafterallnormalheaderlines.(repeatable) -AattributeAddBasicWWWAuthentication,theattributes areacolonseparatedusernameandpassword. -PattributeAddBasicProxyAuthentication,theattributes areacolonseparatedusernameandpassword. //-Pproxy-auth-username:password对一个中转代理提供BASIC认证信任。用户名和密码由一个:隔开,并以base64编码形式发送。无论服务器是否需要(即,是否发送了401认证需求代码),此字符串都会被发送。 -Xproxy:portProxyserverandportnumbertouse -VPrintversionnumberandexit -kUseHTTPKeepAlivefeature -dDonotshowpercentilesservedtable. -SDonotshowconfidenceestimatorsandwarnings. -gfilenameOutputcollecteddatatognuplotformatfile. -efilenameOutputCSVfilewithpercentagesserved -hDisplayusageinformation(thismessage) //-attributes设置属性的字符串.缺陷程序中有各种静态声明的固定长度的缓冲区。另外,对命令行参数、服务器的响应头和其他外部输入的解析也很简单,这可能会有不良后果。它没有完整地实现HTTP/1.x;仅接受某些’预想’的响应格式。strstr(3)的频繁使用可能会带来性能问题,即你可能是在测试ab而不是服务器的性能。 参数很多,一般我们用-c和-n参数就可以了。例如: ab-c5000-n600http://192.163.1.26/
[root@localhostyum.repos.d]#ab-c5000-n600
相关文章推荐
- Ubuntu 下环境搭建系列 —— 安装 Apache Maven
- Apache Shiro详情
- Apache跨域配置
- Apache性能优化
- Apache如何开启Rewrite功能
- Centos6.5 安装Apache下的Thrift
- Use Apache2 on Ubuntu
- Apache Hadoop YARN架构简介
- Apache配置虚拟目录和多主机头
- Linux apache-activemq安装及配置
- Apache Mina 入门实例
- ERROR: org.apache.hadoop.hbase.MasterNotRunningException: Retried 7 times
- apache负载均衡中有关于session会话的问题
- Mac OS X中配置Apache后提示You don't have permission to access / on this server
- 使用Apache配置项目图片地址映射
- Linux系统安装Apache 2.4.6
- Apache Ignite:如何从持久化存储中读取数据
- Windows下PHP开发环境搭建教程(Apache+PHP+MySQL)
- Windows下PHP开发环境搭建教程(Apache+PHP+MySQL)
- apache2添加模块和添加站点