ITeye博客

Siege 使用笔记

joy2everyone · 2012-05-07 18:22 · benchmark · 开源软件 · Markdown

Siege 是一款开源的http/https回归(性能)测试的工具。

测试环境: siege.i686 (2.72-2.fc16) Linux version 3.3.2-6.fc16.i686 (Fedora16)

  1. 安装siege

a.yum list | grep siege b.sudo yum -y install siege.i686

  1. 简单测试
siege -c10 -t10S http://yourapp_services_url

(并发数为10,执行时间为10秒)

(注:针对URL多个参数可以通过以下2种方式来添加,例如:test1=11&test2=22)

siege -c10 -t10S "http://yourapp_services_url?test1=11&test2=22"

或者

siege -c10 -t10S http://yourapp_services_url?test1=11\&test2=22

如果命令如下写法,将会丢失test2参数

siege -c10 -t10S http://yourapp_services_url?test1=11&test2=22
  1. Siege提供URLFile(其中可以定义好多条测试URLs,可将其随即测试执行来模拟,详细见文档)

  2. 性能测试过程中,当并发数达到一定情况下可能会遇到“FATAL: unable to allocate memory for ** simulated browser: Cannot allocate memory”类似错误,这是由于linux系统配置限制导致的,可通过"ulimit -a"查看, 修改参数来进行调试(但总会受限于测试环境的硬件设备)。

  3. 参考文档 .http://www.joedog.org/siege-manual/ .http://www.ibm.com/developerworks/cn/linux/l-cn-ulimit/

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。