Chinaunix首页 | 论坛 | 博客
  • 博客访问: 811745
  • 博文数量: 167
  • 博客积分: 7173
  • 博客等级: 少将
  • 技术积分: 1671
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-04 23:07
文章分类

全部博文(167)

文章存档

2018年(1)

2017年(11)

2012年(2)

2011年(27)

2010年(88)

2009年(38)

分类: 系统运维

2010-08-10 17:40:35

   因为最近想测试一下varnish、nginx proxy_cache的缓存功能,刚开始的时候使用了apache ab进行测试,但发现ab只能针对一个web site,要进行多web site,就要手工干预。后来发现另一个工具--Siege。
   Siege是一个压力测试和评测工具,设计用于WEB开发这块评估应用在压力下的承受能力:可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。

  主页:
  下载页:ftp://ftp.joedog.org/pub/siege/
   安装:tar zxvf xxx.tar.gz && ./configure && make && make install

  使用范例:
siege -c 200 -r 10 -f nginx_cache.list
参数说明:
-c 200 并发20个用户
-r 10 重复循环2次
-f nginx_cache.list 任务列表:URL列表


Transactions: xx hits 完成多少次处理
Availability: xx % 成功率
Elapsed time: xx secs 总共用时
Data transferred: xx bytes 共数据传输
Response time: xx secs 相应用时,显示网络连接的速度
Transaction rate: xx trans/sec 平均每秒完成多少次处理:表示服务器后台处理的速度
Throughput: xx bytes/sec 平均每秒传送数据
Concurrency: xx 最高并发数
Successful transactions: xx 成功处理次数
Failed transactions: xx 失败处理次数


其他的一些参数:
  -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 the
                          transaction. 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 H
                          ex: --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, the
                          default 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 requst
                          between 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 request




在安装siege的时候,还附带了一下额外的工具,例如: bombardment;可以使用它来进行增量
用户压力测试。
例如
bombardment url.list 15 10 5 1
初始化URL列表:url.list 初始化为:15个用户 每次增加:10个用户 运行:5次 每个客户端之间的延迟为:1秒

bombardment
usage:
bombardment [urlfile] [inital # of clients] [inc value] [# of inc] [delay]
阅读(906) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-10-09 11:40:26

转了!

chinaunix网友2010-10-09 11:38:54

sky大大V5!