介绍几款Web服务器性能压力测试工具

一、http_load

程序非常小,解压后也不到100K 
http_load以并行复用的方式运行,用以测试web服务器的吞吐量与负载。 
但是它不同于大多数压力测试工具,它可以以一个单一的进程运行,一般不会把客户机搞死。 
还可以测试HTTPS类的网站请求。 
下载地址:http://www.acme.com/software/http_load/

基本用法:

http_load  -p 并发访问进程数  -s 访问时间  需要访问的URL文件

参数其实可以自由组合,参数之间的选择并没有什么限制。 
比如你写成http_load -parallel 5 -seconds 300 urllist.txt也是可以的。 
我们把参数给大家简单说明一下。 
-parallel 简写-p :含义是并发的用户进程数。 
-fetches 简写-f :含义是总计的访问次数 
-rate 简写-p :含义是每秒的访问频率 
-seconds 简写-s :含义是总计的访问时间 
准备URL文件:urllist.txt,文件格式是每行一个URL,URL最好超过50-100个测试效果比较好。 

二、webbench

webbench是Linux下的一个网站压力测试工具,最多可以模拟3万个并发连接去测试网站的负载能力。 
下载地址可以到google搜,我这里给出一个 
下载地址:http://soft.vpser.net/test/webbench/webbench-1.5.tar.gz 
这个程序更小,解压后不到50K

用法:webbench -c 并发数 -t 运行测试时间 URL 

 

三、ab

ab是apache自带的一款功能强大的测试工具。 
安装了apache一般就自带了。 
用法可以查看它的说明

navy@deepin:~/Downloads$ ab
ab: wrong number of arguments
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 at a time
    -t timelimit    Seconds to max. to spend on benchmarking
                    This implies -n 50000
    -s timeout      Seconds to max. wait for each response
                    Default is 30 seconds
    -b windowsize   Size of TCP send/receive buffer, in bytes
    -B address      Address to bind to when making outgoing connections
    -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 to use for POST/PUT data, 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.
    -q              Do not show progress when doing more than 150 requests
    -l              Accept variable document length (use this for dynamic pages)
    -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.
    -m method       Method name
    -h              Display usage information (this message)
    -I              Disable TLS Server Name Indication (SNI) extension
    -Z ciphersuite  Specify SSL/TLS cipher suite (See openssl ciphers)
    -f protocol     Specify SSL/TLS protocol
                    (TLS1, TLS1.1, TLS1.2 or ALL)

用法实例:ab -c 并发数 -n 请求总数 测试地址

四、Siege

一款开源的压力测试工具,可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。 
Siege官方:http://www.joedog.org/ 
Siege下载:http://www.joedog.org/pub/siege/siege-latest.tar.gz 

 安装与使用:https://www.cnblogs.com/navysummer/p/9100566.html

 

posted @ 2018-05-29 16:18  NAVYSUMMER  阅读(168)  评论(0编辑  收藏  举报
交流群 编程书籍