网站地图    收藏   

主页 > 系统 > apache教程 >

使用ApacheBench进行网站性能测试|to-Apache教程

来源:自学PHP网    时间:2014-10-14 00:06 作者: 阅读:

[导读] ...

apacheBench 主要是用来测试阿帕奇服务器执行效率用的。安装好apache服务器套件后,进入bin目录,就可以找到该可执行文件ab.exe。

         ApacheBench可以针对某一特定URL模拟出连续的联机请求,同时还可以仿真出同时间点个数相同的联机请求,因而利用 ApacheBench 可帮助我们在网站开发期间仿真实际上线可能的情况,利用仿真出来的数据做为调整服务器设定或程序的依据。

ab用法如下

Usage: ab [options] [http[s]://]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
    -p postfile     File containing data to POST
    -T content-type Content-type header for POSTing
    -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
    -s              Use httphotoshop/ target=_blank class=infotextkey>ps instead of HTTP (SSL)
    -h              Display usage information (this message)

使用ApacheBench进行网站性能测试》由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Server/Apache/17837.html

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论