使用urls.txt文件时,Siege不会停止

时间:2016-01-22 17:01:00

标签: csv siege

我正在使用围攻在我们的新站点地图上找到一些问题页面,并且在运行urls.txt文件后无法停止它。我尝试在命令行中使用reps = once,以及在.siegerc配置文件中使用。我发现我必须使用配置文件,因为我希望将输出冗长地写入日志文件,以便我可以看到页面加载时间,302和404错误等,并将它们导入到excel中。然而,无论我尝试什么,我都无法在完成url.txt文件时停止围攻 - 它只是再次重新运行它。 我配置了40个并发用户,时间和reps变量在config中注释掉,url.txt文件在config中。我在cmd行运行的语法是...... sudo siege --reps = once -v> outputfile.csv

我已尝试在配置中设置代表,没有运气。我出错的任何想法?

1 个答案:

答案 0 :(得分:2)

我遇到了类似的问题并尝试了多种选项,我可以使用它:

# siege -c 10 -b -r 10 -f urls.txt

其中urls.txt是一个简单的URL列表,如

http://ip-address/url1.html
http://ip-address/url2.html
....
....

将日志写入siegerc文件中指定的文件中。 $ {HOME} /var/siege.log

2016-08-05 17:52:59,    100,       0.88,           4,       0.09,      113.64,        4.55,        9.67,     100,       0
2016-08-05 17:53:00,    100,       0.91,           4,       0.09,      109.89,        4.40,        9.76,     100,       0
2016-08-05 17:53:01,    100,       0.90,           4,       0.09,      111.11,        4.44,        9.78,     100,       0
2016-08-05 17:53:02,    100,       0.89,           4,       0.09,      112.36,        4.49,        9.64,     100,       0
2016-08-05 17:53:03,    100,       0.86,           4,       0.08,      116.28,        4.65,        9.84,     100,       0
2016-08-05 17:53:04,    100,       0.89,           4,       0.09,      112.36,        4.49,        9.80,     100,       0
2016-08-05 17:53:05,    100,       0.88,           4,       0.09,      113.64,        4.55,        9.83,     100,       0
2016-08-05 17:53:06,    100,       0.88,           4,       0.09,      113.64,        4.55,        9.89,     100,       0
2016-08-05 17:53:07,    100,       0.87,           4,       0.09,      114.94,        4.60,        9.79,     100,       0
2016-08-05 17:53:07,    100,       0.88,           4,       0.09,      113.64,        4.55,        9.85,     100,       0

}

我还观察到日志文件选项要么是错误的要么是非常严格的。 '-l filename.log'不起作用。

$ siege -c 10 -b -r 10 -f urls.txt -l ./siege.log
** SIEGE 2.70
** Preparing 10 concurrent users for battle.
The server is now under siege...
done.
Transactions:                      0 hits
Availability:                   0.00 %
Elapsed time:                   0.08 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:             100
Longest transaction:            0.00
Shortest transaction:           0.00

FILE: /home/xxxx/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.

但是--log = filename.log有效。 e.g。

# siege -c 10 -b -r 10 -f urls.txt --log=./siege.log
$ siege -c 10 -b -r 10 -f urls.txt --log=./siege.log
** SIEGE 2.70
** Preparing 10 concurrent users for battle.
The server is now under siege...
HTTP/1.1 200   0.08 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.08 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.09 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.09 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   45807 bytes ==> /8af6cacb-50ed-40b6-995f-49480f9f74fa.html
HTTP/1.1 200   0.10 secs:   55917 bytes ==> /create_and_delete_networks.html
HTTP/1.1 200   0.10 secs:   55917 bytes ==> /create_and_delete_networks.html
HTTP/1.1 200   0.10 secs:   55917 bytes ==> /create_and_delete_networks.html
HTTP/1.1 200   0.10 secs:   55917 bytes ==> /create_and_delete_networks.html
HTTP/1.1 200   0.09 secs:   55917 bytes ==> /create_and_delete_networks.html

done.
Transactions:                    100 hits
Availability:                 100.00 %
Elapsed time:                   0.89 secs
Data transferred:               4.60 MB
Response time:                  0.09 secs
Transaction rate:             112.36 trans/sec
Throughput:                     5.16 MB/sec
Concurrency:                    9.74
Successful transactions:         100
Failed transactions:               0
Longest transaction:            0.15
Shortest transaction:           0.05

FILE: ./siege.log
You can disable this annoying message by editing
the .siegerc file in your home directory; change

希望这有帮助。