为什么该工具不能与HTTPS站点一起使用? [英] Why is the "Siege"-tool not working with HTTPS sites?
问题描述
我使用的是CentOS 6.4中的围城3.0.3。
我的问题是:‘围城’如何支持HTTPS协议?
到目前为止,使用此工具可以进行HTTP站点测试。
但是,我在处理HTTPS站点时遇到了某些问题(如下所述)。
按照某人的建议,为了让HTTPS正常工作,我用OpenSSL编写了《围城》。
为此,我遵循了以下站点中提到的程序。 http://drewsymo.com/how-to/installing-siege-stress-tester-on-centos-6-3/
简而言之,我运行了以下命令来编译OpenSSL围城。
cd /opt
wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
tar -zxvf openssl-1.0.1e.tar.gz
cd siege-3.0.3
./configure -with-ssl=/opt/openssl-1.0.1e
make && make install
我在上述步骤中没有收到任何警告或错误。
但是,即使在此之后,我在使用此工具处理HTTPS站点时仍获得以下结果。
第1期
每当我设置了许多像1000、2000这样的点击数时,我都会收到以下错误。
"Segmentation fault (core dumped)"
请注意,我已经运行了"ulimit-n 10000"命令以增加打开的文件数。
但是,这并没有帮助。
第2期
[root@localhost ~]# siege --user-agent="Mozilla/5.0 (Windows NT 6.2; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0" -c10 -r1 -t50S someHTTPSdomain.com
[error] CONFIG conflict: selected time and repetition based testing: No such file or directory
defaulting to time-based testing: 50 seconds
** SIEGE 3.0.3
** Preparing 10 concurrent users for battle.
The server is now under siege...
HTTP/1.1 302 0.09 secs: 0 bytes ==> GET /
HTTP/1.1 302 0.11 secs: 0 bytes ==> GET /
HTTP/1.1 302 0.08 secs: 0 bytes ==> GET /
HTTP/1.1 302 3.09 secs: 0 bytes ==> GET /
.....................
.....................
.....................
Then after many such hits exceeding the above defined 10 hits, I had to press Ctrl+C.
After that, it shows,
^C
Lifting the server siege... done.
Transactions: 0 hits
Availability: 0.00 %
Elapsed time: 18.70 secs
Data transferred: 0.00 MB
Response time: 0.00 secs
Transaction rate: 0.00 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 3.19
Successful transactions: 30
Failed transactions: 28
Longest transaction: 12.10
Shortest transaction: 0.07
FILE: /usr/local/var/siege.log
You can disable this annoying message by editing
the .siegerc file in your home directory; change
the directive 'show-logfile' to false.
[root@localhost ~]#
为什么HTTPS站点的交易总是显示0次点击?
即使指定了"-c10-r1",为什么HTTPS站点的滚动输出不会停止?
还有,为什么HTTPS站点的所有HTTP响应都显示为30倍?
为什么会出现此错误"[Error]配置冲突:基于选定时间和重复的测试:没有此类文件或目录默认为基于时间的测试:50秒"继续显示?
不管怎样,如果我从上面的命令中删除-t50S,我没有收到错误"[ERROR]配置冲突:选定的时间和基于重复的测试:没有这样的文件或目录默认为基于时间的测试:50秒"。
但是,它仍然将事务显示为0次命中。见下文。
[root@localhost ~]# siege --user-agent="Mozilla/5.0 (Windows NT 6.2; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0" -c10 -r1 someHTTPSdomain.com
** SIEGE 3.0.3
** Preparing 10 concurrent users for battle.
The server is now under siege...
HTTP/1.1 302 0.08 secs: 0 bytes ==> GET /
HTTP/1.1 302 0.08 secs: 0 bytes ==> GET /
HTTP/1.1 302 0.09 secs: 0 bytes ==> GET /
HTTP/1.1 302 0.11 secs: 0 bytes ==> GET /
HTTP/1.1 302 0.07 secs: 0 bytes ==> GET /
HTTP/1.1 302 0.09 secs: 0 bytes ==> GET /
HTTP/1.1 302 0.08 secs: 0 bytes ==> GET /
HTTP/1.1 302 0.08 secs: 0 bytes ==> GET /
HTTP/1.1 302 0.08 secs: 0 bytes ==> GET /
HTTP/1.1 302 0.10 secs: 0 bytes ==> GET /
done.
Transactions: 0 hits
Availability: 0.00 %
Elapsed time: 2.14 secs
Data transferred: 0.00 MB
Response time: 0.00 secs
Transaction rate: 0.00 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 0.40
Successful transactions: 10
Failed transactions: 10
Longest transaction: 0.11
Shortest transaction: 0.07
FILE: /usr/local/var/siege.log
You can disable this annoying message by editing
the .siegerc file in your home directory; change
the directive 'show-logfile' to false.
[root@localhost ~]#
第3期
还有一件事,我注意到如果我在HTTPS URL前面加上一个前缀,"https://"就像下面这样,我会得到这样的输出。
[root@localhost ~]# siege --user-agent="Mozilla/5.0 (Windows NT 6.2; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0" -c10 -r1 https://someHTTPSdomain.com
** SIEGE 3.0.3
** Preparing 10 concurrent users for battle.
The server is now under siege...
done.
Transactions: 0 hits
Availability: 0.00 %
Elapsed time: 1.06 secs
Data transferred: 0.00 MB
Response time: 0.00 secs
Transaction rate: 0.00 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 0.00
Successful transactions: 0
Failed transactions: 10
Longest transaction: 0.00
Shortest transaction: 0.00
FILE: /usr/local/var/siege.log
You can disable this annoying message by editing
the .siegerc file in your home directory; change
the directive 'show-logfile' to false.
[root@localhost ~]#
简单地说,没有HTTP或其他响应消息。
我在处理HTTPS站点时对这些结果感到困惑。不清楚我在发出命令时是否做错了什么,或者是某个错误或此工具的限制。
我想指出的是,在上面的命令中,我使用了有效的Windows 8(使用Firefox浏览器)用户代理,方法是在所有命令中使用"--user-agent="。 我这样做只是为了替换默认的围城用户代理,它是"JoeDog/1.00[en](X11;i;Siegence 3.0.3)",因为这个默认的围城用户代理可能会被列入许多网络服务器的黑名单(不太确定)。
请人指点一下。
提前谢谢。
推荐答案
正如另一个帖子所说,您必须使用--推荐答案-ssl选项进行配置。此外,还必须安装OpenSSL开发头。如果您没有SSL头./CONFIGURE,Make和Make Install将运行得很好,并且他们将安装一个有效的攻城战二进制文件,但它将不能处理HTTPS。
这篇关于为什么该工具不能与HTTPS站点一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!