需求(一):使用siege对多个页面进行加压
- 负责人希望各位测试同学可以对ur.tencent.com的下面3个页面进行加压,以便暴露系统的瓶颈。
http://ur.tencent.com/categories/7
http://ur.tencent.com/categories/7/?page=2
http://ur.tencent.com/categories/7/?page=3
- 并发数是5,持续运行1分钟;
- 压测时候启用gzip压缩;
- 测试结果日志输出为CSV格式
命令:siege -c 5 -t 1M -H "Accept-Encording:gzip" --log=result_gzip.csv
日志:result_gzip
备注:
- 没有sz命令,使用安装命令 yum install lrzsz
- 用siege -C 查看urls文件路径,可以使用默认的urls.txt
需求(二):对移动站点进行压测
- 负责人希望各位测试同学可以对www.baidu.com移动版本进行加压;
- 并发数是1,重复次数1;
- 模拟iphone5;
参考:Complete List of iOS User-Agent Strings
User-Agent String
Apple-iPhone5C2/1001.525 iPhone 5 CDMA 6.0.1 10A525 Nov 1, 2012
[root@localhost Desktop]# siege -c 1 -r 1 -A "Apple-iPhone5C2/1001.525" http://www.baidu.com
[alert] Zip encoding disabled; siege requires zlib support to enable it
** SIEGE 4.0.4
** Preparing 1 concurrent users for battle.
The server is now under siege...
HTTP/1.1 200 0.04 secs: 2925 bytes ==> GET /
HTTP/1.1 200 0.04 secs: 2340 bytes ==> GET /static/index/u.png
Transactions: 2 hits
Availability: 100.00 %
Elapsed time: 0.08 secs
Data transferred: 0.01 MB
Response time: 0.04 secs
Transaction rate: 25.00 trans/sec
Throughput: 0.06 MB/sec
Concurrency: 1.00
Successful transactions: 2
Failed transactions: 0
Longest transaction: 0.04
Shortest transaction: 0.04
网友评论