0

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

我试过在配置中设置代表,没有运气。有什么想法我哪里出错了吗?

4

1 回答 1

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 文件名.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 有效。例如

# 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

希望这可以帮助。

于 2016-08-06T01:07:49.780 回答