GatewayWorker作为websocket客户端,用的AsyncTcpConnection,报错

skl_TZ

GatewayWorker作为websocket客户端,用的AsyncTcpConnection,开到200个客户端的时候是正常的,开到300个客户端的时候就出现如下错误:

Warning: stream_socket_client(): unable to connect to tcp://127.0.0.1:8888 (Unknown error) in /Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/Connection/AsyncTcpConnection.php on line 104
PHP Warning:  require_once(/Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/GatewayWorker/Lib/Context.php): failed to open stream: Too many open files in /Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/Autoloader.php on line 60

Warning: require_once(/Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/GatewayWorker/Lib/Context.php): failed to open stream: Too many open files in /Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/Autoloader.php on line 60
PHP Fatal error:  require_once(): Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/../GatewayWorker/Lib/Context.php' (include_path='.:') in /Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/Autoloader.php on line 60

Fatal error: require_once(): Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/../GatewayWorker/Lib/Context.php' (include_path='.:') in /Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/Autoloader.php on line 60
WORKER EXIT UNEXPECTED E_COMPILE_ERROR require_once(): Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/../GatewayWorker/Lib/Context.php' (include_path='.:') in /Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/Autoloader.php on line 60
PHP Warning:  file_put_contents(/Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/../workerman.log): failed to open stream: Too many open files in /Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/Worker.php on line 1299

Warning: file_put_contents(/Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/../workerman.log): failed to open stream: Too many open files in /Applications/XAMPP/xamppfiles/htdocs/ttcq/Workerman/Workerman/Worker.php on line 1299
worker exit with status 65280

需求需要,要开到3000个客户端,想问下有没有解决方案

6838 1 0
1个回答

walkor 打赏

系统内核配置问题。
Too many open files ,进程打开文件数量超过了系统限定值,估计你的系统限定值是256.

请参照手册优化linux内核,增大这个值
http://doc3.workerman.net/appendices/kernel-optimization.html

  • 暂无评论
年代过于久远,无法发表回答
×
🔝