由于套接字故障过多,攻击被中止。

15

我在尝试在 Mac OS X 10.8.3 上运行 Siege 的以下命令时遇到了这个问题。

siege -d1 -c 20 -t2m -i -f -r10 urls.txt

Siege 的输出如下:

** SIEGE 2.74
** Preparing 20 concurrent users for battle.
The server is now under siege...
done.
siege aborted due to excessive socket failure; you
can change the failure threshold in $HOME/.siegerc

Transactions:                  0 hits
Availability:               0.00 %
Elapsed time:              27.04 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:            1043
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.

2
看起来你正在检查一个宕机的主机。 - Sergei Nikulov
2个回答

7
问题可能是您的短暂端口已经用完。为了解决这个问题,可以扩展可用端口数量,或缩短端口停留在TIME_WAIT状态的时间,或两者都做。
扩大可用端口:
检查当前设置: $ sudo sysctl net.inet.ip.portrange.hifirst
net.inet.ip.portrange.hifirst: 49152
将其设置为较低值以扩大窗口: $ sudo sysctl -w net.inet.ip.portrange.hifirst=32768
net.inet.ip.portrange.hifirst: 49152 -> 32768
(hilast 应该已经达到最大值 65536)
缩短最大分段生存时间: $ sudo sysctl -w net.inet.tcp.msl=1000
net.inet.tcp.msl: 15000 -> 1000

7
听起来可信,但对我没有帮助。 - RomanKousta

0
我也遇到了这个错误。结果发现我的URI有问题。其中大部分返回404或500状态。当我修复了URI后,一切都顺利了。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接