Web压力测试工具Siege安装

来源:互联网 发布:qt creator是什么软件 编辑:程序博客网 时间:2024/05/22 13:42

Web压力测试工具Siege安装

Siege是我所用过的一款不错的网站压力测试工具,它可以非常容易地定制并发访问人数以及并发时间,安装、使用也非常方便,当然它是在Linux环境下使用的,下面来对它作一个介绍。官方网址:http://www.joedog.org/  ---> download -----> siege安装解压:tar zxvf  ..... ,进入到解压后的目录:,运行命令:./configuremakemake install如果不行的话用sudo命令输入:siege –help,如果安装没问题会出现以下类似信息:SIEGE 2.70Usage: siege [options]siege [options] URLsiege -g URLOptions:-V, –version           VERSION, prints the version number.-h, –help              HELP, prints this section.-C, –config            CONFIGURATION, show the current config.-v, –verbose           VERBOSE, prints notification to screen.-g, –get               GET, pull down HTTP headers and display thetransaction. Great for application debugging.-c, –concurrent=NUM    CONCURRENT users, default is 10-i, –internet          INTERNET user simulation, hits URLs randomly.-b, –benchmark         BENCHMARK: no delays between requests.-t, –time=NUMm         TIMED testing where “m” is modifier S, M, or Hex: –time=1H, one hour test.-r, –reps=NUM          REPS, number of times to run the test.-f, –file=FILE         FILE, select a specific URLS FILE.-R, –rc=FILE           RC, specify an siegerc file-l, –log[=FILE]        LOG to FILE. If FILE is not specified, thedefault is used: PREFIX/var/siege.log-m, –mark=”text”       MARK, mark the log file with a string.-d, –delay=NUM         Time DELAY, random delay before each requstbetween 1 and NUM. (NOT COUNTED IN STATS)-H, –header=”text”     Add a header to request (can be many)-A, –user-agent=”text” Sets User-Agent in requestCopyright (C) 2010 by Jeffrey Fulmer, et al.This is free software; see the source for copying conditions.There is NO warranty; not even for MERCHANTABILITY or FITNESSFOR A PARTICULAR PURPOSE.上面也是运行的一些参数,右边是对一些参数的解释说明比如:C :查看siege当前的配置信息V:版权说明信息c:并行启动(访问)用户数,默认是10-t:压力测试时间,比如-t5表示持续时间是5分钟-r:每个连接发出的请求数量,这个与t有些类似,所以设置了这个值就不需要设置t了,反之亦然。-f:对应一个文件,这个文件里每一行为一个URL链接,格式如:http://www.zihou.mehttp://www.zihou.me/2010/12/16/2821/http://www.zihou.me/2010/12/14/2806/使用:1、  启动100个用户(线程)在5分钟内对某一页面www.zihou.me进行并发访问siege http://www.zihou.me -c200 -t52、  对多个页面进行并发访问新建一个文件urls,里面的内容为(只是例子,任何url都可以):http://www.zihou.mehttp://www.zihou.me/2010/12/16/2821/http://www.zihou.me/2010/12/14/2806/siege -f urls -c200 -t5表示启动200个用户在5分钟内并发访问以上的url网址。并发测试完毕后,会打印出一些结果信息:Lifting the server siege…      done.Transactions:                   7555 hitsAvailability:                  99.47 %Elapsed time:                 299.92 secsData transferred:              99.17 MBResponse time:                  7.30 secsTransaction rate:              25.19 trans/secThroughput:                     0.33 MB/secConcurrency:                  183.84Successful transactions:        7555Failed transactions:              40Longest transaction:           17.94Shortest transaction:           0.02如果在并发的过程中,被访问的页面打开出错或及其缓慢,表示在当前并发条件下,被访问网站是不能承受的,也就是抗并发能力弱。另外,在并发的过程中最好通过top命令来查看CPUMemory的占用情况。
0 0
原创粉丝点击