2013-05-09 173 views
12

我在嘗試從Mac OS X 10.8.3圍攻下面的cmd時遇到此問題。由於套接字失敗而導致圍困中止

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

從圍困輸出如下:

** 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

它看起來像你檢查主機這是下降。 – 2013-05-09 13:46:35

回答

2

的問題可能是你用盡臨時端口。要解決該問題,請擴展要使用的端口數量,或者減少端口保留在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

+3

聽起來似乎合理,但沒有幫助我。 – 2015-04-27 18:07:00

相關問題