【问题标题】:Siege will not stop when done with urls.txt file完成 urls.txt 文件后,围攻不会停止
【发布时间】:2016-04-29 08:58:01
【问题描述】:

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

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

【问题讨论】:

  • 你能告诉我们你的努力吗?
  • 好吧,我将 .siegerc 文件设置为 reps = 1,但这不起作用。我将它设置为 reps = 一次,那也没有用。我对两者都注释掉了时间价值。我厌倦了通过命令行以两种方式指定一个代表 - 这不起作用。我的 urls.txt 文件包含一个站点地图、9070 个 url,并且 siege 确实击中了所有这些,但是一旦到达终点,它似乎就重新开始,因为我的日志文件一直在增长,直到我中断操作。

标签: csv siege


【解决方案1】:

我遇到了类似的问题,并尝试了多种解决方案:

# 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

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-08
    • 1970-01-01
    • 2021-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多