假定:
1 centos 系统 root登录2 siege-2.72版本 下载自:http://www.joedog.org3 openssl 安装路径 /usr/local/ssl4 使用人员:php开发人员关于siege的说明请先参考http://www.joedog.org选择siege的理由:1 稳定2 除了对http支持外,还支持https,并且支持的很好,apachebanch 对https支持的不够好。3 安装简单,功能够开发测试用一、siege的安装cd /root/rztar -zxvf siege-2.72.tar.gzcd siege-2.72./configure --prefix=/usr/local/siege --mandir=/usr/local/man --with-ssl=/usr/local/sslmkdir -p /usr/local/siege/etc/mkdir -p /usr/local/siege/var/makemake install创建.siegec.config配置文件到当前用户的家目录下/usr/local/siege/bin/siege.config安装完成查看配置文件/usr/local/siege/bin/siege -CCURRENT SIEGE CONFIGURATIONJoeDog/1.00 [en] (X11; I; Siege 2.72)Edit the resource file to change the settings.----------------------------------------------version: 2.72verbose: falsedebug: falseprotocol: HTTP/1.1connection: closeconcurrent users: 15time to run: n/arepetitions: n/asocket timeout: 30delay: 1 secinternet simulation: falsebenchmark mode: falsefailures until abort: 1024named URL: noneURLs file: /usr/local/siege/etc/urls.txtlogging: truelog file: /usr/local/siege/var/siege.logresource file: /root/.siegerctimestamped output: falsecomma separated output: falseallow redirects: trueallow zero byte data: trueallow chunked encoding: trueproxy auth: www auth: 二、siege的使用举例说明:50个用户(每次并发量,注意不是每秒并发量) 重复100次 共产生 50 * 100 = 5000个请求/usr/local/siege/bin/siege -c 50 -r 100 https://www.abc.com/a.php50个用户 重复100次 发送GET参数/usr/local/siege/bin/siege -c 50 -r 100 https://www.abc.com/a.php?name=zhangsan50个用户 重复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"Transactions: 25000 hits 意思是总共完成了25000次测试
Availability: 100.00 % 测试的有效性100%
Elapsed time: 65.52 secs 用时65.52秒
Data transferred: 83.65 MB 传输了83.65MB数据
Response time: 0.57 secs 响应时间
Transaction rate: 381.56 trans/sec 每秒传输381.56次
Throughput: 1.28 MB/sec 数据吞吐量每秒1.28MB
Concurrency: 216.02 实际并发访问
Successful transactions: 21707 成功的传输
Failed transactions: 0 失败的传输
Longest transaction: 5.83 每次传输所花最长时间
Shortest transaction: 0.00 每次传输所花最短时间
转自 http://blog.csdn.net/linuxchen/article/details/2334626