Siege 使用笔记

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

2. 简单测试

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


3. Siege提供URLFile(其中可以定义好多条测试URLs,可将其随即测试执行来模拟,详细见文档)

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

5. 参考文档
[1]. http://www.joedog.org/siege-manual/
[2]. http://www.ibm.com/developerworks/cn/linux/l-cn-ulimit/



猜你喜欢

转载自joy2everyone.iteye.com/blog/1514645
今日推荐