Centos Siege测试使用
http://drewsymo.com/2013/11/installing-siege-stress-tester-on-centos-6-3/
一、简介
一款开源的压力测试工具,可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过
程的相应时间,并在一定数量的并发访问下重复进行。
Installing Siege Stress Tester on CentOS 6.3
Siege, similar to Apache Benchmark, is an amazing stress testing tool for your web-server. You can spin up a number of connections to simulate concurrency of transactions and gain invaluable insight into how your app or website might perform while under, well, stress!
How to Install Siege on CentOS 6.3
To get started, simply download Siege from the official website and unpack it using Tar:
cd /opt wget http://www.joedog.org/pub/siege/siege-2.72.tar.gz tar -zxvf siege-2.72.tar.gz
Next, navigate to the Siege folder and compile it:
cd /opt/siege-2.72 ./configure make && make install
You’re done, let’s confirm that Siege is working by checking its version:
siege -v
Siege Examples
Try running a few of the Siege Examples below (at your own discretion) to verify that your setup is working:
siege -c25 -t1M www.example.com siege -c25 -t50s example.com
Common Errors
[alert] unsupported protocol
If you receive this error message, it means that you’re trying to Siege a website using https (SSL) without SSL installed – or – Siege cannot determine the location of your OpenSSL installation.
To fix this error, simply compile OpenSSL statically with Siege to get SSL support:
cd /opt wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz tar -zxvf openssl-1.0.1e.tar.gz cd siege-2.72.tar.gz ./configure -with-ssl=/opt/openssl-233
四、使用
参数说明:
输入名称 | 解释说明 |
-V, --version | 打印版本信息 |
-h, --help | 打印帮助信息 |
-C, --config | 显示配置信息。 |
-v, --verbose | 打印冗余配置信息。 |
-g, --get | 显示HTTP交易。 |
-c, --concurrent=NUM | 设置并发用户数 |
-u, --url="URL" | 设置被测Web的URL |
-i, --internet | 用户模拟、随机访问URL |
-b, --benchmark . | 基准测试。 |
-t, --time=NUM | 设置测试时间。 |
-r, --reps=NUM | 设置测试次数 |
-f, --file=FILE | 更改配置文件存档 |
-R, --rc=FILE | 更改siegerc文件和环境变量 |
-l, --log | 测试日志 |
-m, --mark="text" | 标记测试日志 |
-d, --delay=NUM | 设置时间延迟 |
-H, --header="text" | 增加测试头文件 |
-A, --user-agent="text" | 设置代理测试请求 |
终端执行:
/usr/local/siege/bin/siege -c300 -t10S http://192.168.1.108/admin/login.aspx
得到一下数据:
输出名称 | 解释说明 |
Transactions: | 访问次数 |
Availability: | 成功次数 |
Elapsed time: | 测试用时 |
Data transferred: | 测试传输数据量 |
Response time: | 平均响应时间 |
Transaction rate: | 每秒事务处理量 |
Throughput: | 吞吐率 |
Concurrency: | 并发用户数 |
Successful transactions: | 成功传输次数 |
Failed transactions: | 失败传输次数 |
Longest transaction: | 最长响应时间 |
Shortest transaction: | 最短响应时间 |
Transactions: 54298 hits
Availability: 100.00 %
Elapsed time: 9.78 secs
Data transferred: 8.13 MB
Response time: 0.05 secs
Transaction rate: 5551.94 trans/sec
Throughput: 0.83 MB/sec
Concurrency: 298.67
Successful transactions: 54298
Failed transactions: 0
Longest transaction: 0.19
Shortest transaction: 0.00
posted on 2014-08-06 13:39 天地一连线_孤鸿挂飘渺 阅读(484) 评论(0) 编辑 收藏 举报