好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

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

apache Bench 主要是用来测试阿帕奇 服务器 执行效率用的。 安装 好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 pass word .
    -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 htt photoshop / 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

查看更多关于使用ApacheBench进行网站性能测试|to-Apache教程的详细内容...

  阅读:72次