压测工具siege

1. 简介

Siege是一个开源的回归测试、基准测试工具。它能够以指定数量的模拟用户对单个url加压;或者读多个url到内存,然后同时对它们加压。

2. 安装(mac下)

brew install siege

3. 使用

一个简单的使用例子:

siege -c 10 -r 10 http://www.baidu.com

(1)常用选项

-c, --concurrent=NUM      并发用户,默认是10
-r, --reps=NUM            运行测试的次数
-t, --time=NUMm           测试时间,这里"m"可以是S, M, 或 H
-f, --file=FILE           选择一个制定了urls的文件
-d, --delay=NUM           时间延迟, 每次发送请求前随机延迟
-b, --benchmark           请求间无延迟

(2)发post

一个例子:

siege -c 10 -r 10 "http://127.0.0.1/index POST method=predict&content=haha"

(3)输出结果说明

指标含义
Transactions总共测试次数
Availability成功次数百分比
Elapsed time总共耗时多少秒
Data transferred总共数据传输
Response time等到响应耗时
Transaction rate平均每秒处理请求数
Throughput吞吐率
Concurrency最高并发
Successful transactions成功的请求数
Failed transactions失败的请求数


Ref

http://blog.csdn.net/qingye2008/article/details/34500949

很好用的网络测试工具 Linux版 siege的安装 unzip filename.zip cd siege-*.*.* ./configure --prefix=/usr/local/siege --mandir=/usr/local/man --with-ssl=/usr/local/ssl mkdir -p /usr/local/siege/etc mkdir -p /usr/local/siege/var make make install 查看配置文件 /usr/local/siege/bin/siege -C 二、siege的使用 举例说明: 50个用户(每次并发量)重复100次 共产生 50*100 个请求 /usr/local/siege/bin/siege -c 50 -r 100 www.baidu.com 50个用户 重复100次 发送GET参数 /usr/local/siege/bin/siege -c 50 -r 100 http://www.baidu.com/s?wd=siege&rsv_spt=1&issp=1&rsv_bp=0&ie=utf-8&tn=baiduhome_pg&rsv_sug3=4&rsv_sug=2&rsv_sug1=4&rsv_sug4=60 50个用户 重复100次 发送POST参数 (注意引号) /usr/local/siege/bin/siege -c 50 -r 100 "https://www.abc.com/a.php POST name=zhangsan" 50个用户 重复100次 发送POST参数(从文件中读取) /usr/local/siege/bin/siege -c 50 -r 100 "https://www.abc.com/a.php POST < /root/ab_test/post.xml" 另外还有挺多参数 详情请man 或 siege -h siege报表解析,请man查看,暂略(有点累了,不想写了。。。。。)。 Transactions: 10 hits :服务器接收的请求数 Availability: 100.00 % :有效情况的比例 Elapsed time: 1.06 secs : 测试所用的时间 Data transferred: 0.04 MB :每个模拟用户的数据传输量 Response time: 0.03 secs :响应每个模拟用户请求的平均时间 Transaction rate: 9.43 trans/sec :服务器每秒处理事务的平均数 Throughput: 0.04 MB/sec :服务器每秒跟所有模拟用户的数据传输量 Concurrency: 0.25 :每秒的模拟连接 Successful transactions: 10 :处理成功的事务数(code<400) Failed transactions: 0 : 处理失败的事务数(code>400) Longest transaction: 0.04 :最长的事务处理时间 Shortest transaction: 0.02 :最短的事务处理时间
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值