web测试工具siege
Siege(英文意思是围攻)是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承受能力:可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。
1.下载
Siege时一个开放源代码项目:http://www.joedog.org/siege/
2.安装:
$./configure
$make #make install
3.使用样例:
(1)任务列表:test.url文件
http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=0 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=10 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=11 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=12 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=13 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=200 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=201 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=210 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=211 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=202 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=203 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=212 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=213 http://10.0.5.199:8080/hadoopWebGis2/PictureServlet?img=220
……
(2)测试命令:
$siege -c 20 -r 2 -f test.url
参数说明:
-c 20 并发20个用户
-r 2 重复循环2次
-f test.url 任务列表:URL列表
(3)输出样例:
注意:由于速度很快,可能会达不到并发速度很高就已经完成。Response time显示的是测试机器和被测试服务器之间网络链接状况。Transaction rate则表示服务器端任务处理的完成速度。
** Siege 2.59
** Preparing 20 concurrent users for battle. 这次“战斗”准备了20个并发用户
The server is now under siege.. done. 服务在“围攻”测试中:
Transactions: 40 hits 完成40次处理
Availability: 100.00 % 成功率
Elapsed time: 7.67 secs 总共用时
Data transferred: 877340 bytes 共数据传输:877340字节
Response time: 1.65 secs 相应用时1.65秒:显示网络连接的速度
Transaction rate: 5.22 trans/sec 平均每秒完成5.22次处理:表示服务器后台处理的速度
Throughput: 114385.92 bytes/sec 平均每秒传送数据:114385.92字节
Concurrency: 8.59 最高并发数 8.59
Successful transactions: 40 成功处理次数
Failed transactions: 0 失败处理次数

浙公网安备 33010602011771号