gpt4 book ai didi

linux - 围攻因套接字故障过多而中止

转载 作者:IT王子 更新时间:2023-10-29 00:27:53 24 4
gpt4 key购买 nike

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

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.

最佳答案

问题可能是您用完了临时端口。要解决这个问题,要么增加要使用的端口数量,要么减少端口停留在 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

关于linux - 围攻因套接字故障过多而中止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16463279/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com