分布式stream_socket_client(): unable to connect to tcp://172.31.18.200:4507 (Connection timed out) in

黑老怪

分布式之后会有这个异常错误 而且几台服务器都有 请问应该怎么排查 而且是开启一段时间后出现

PHP Warning:  stream_socket_client(): unable to connect to tcp://172.31.18.200:4507 (Connection timed out) in /www/wwwroot/Route2/vendor/workerman/gateway-worker/src/Lib/Gateway.php on line 1151

Warning: stream_socket_client(): unable to connect to tcp://172.31.18.200:4507 (Connection timed out) in /www/wwwroot/Route2/vendor/workerman/gateway-worker/src/Lib/Gateway.php on line 1151
Exception: can not connect to tcp://172.31.18.200:4507 Connection timed out in /www/wwwroot/Route2/vendor/workerman/gateway-worker/src/Lib/Gateway.php:1153
Stack trace:
#0 /www/wwwroot/Route2/vendor/workerman/gateway-worker/src/Lib/Gateway.php(1098): GatewayWorker\Lib\Gateway::sendAndRecv()
#1 /www/wwwroot/Route2/vendor/workerman/gateway-worker/src/BusinessWorker.php(382): GatewayWorker\Lib\Gateway::getSession()
#2 /www/wwwroot/Route2/vendor/workerman/workerman/Connection/TcpConnection.php(638): GatewayWorker\BusinessWorker->onGatewayMessage()
#3 [internal function]: Workerman\Connection\TcpConnection->baseRead()
#4 /www/wwwroot/Route2/vendor/workerman/workerman/Events/Event.php(193): EventBase->loop()
#5 /www/wwwroot/Route2/vendor/workerman/workerman/Worker.php(2417): Workerman\Events\Event->loop()
#6 /www/wwwroot/Route2/vendor/workerman/gateway-worker/src/BusinessWorker.php(197): Workerman\Worker->run()
#7 /www/wwwroot/Route2/vendor/workerman/workerman/Worker.php(1541): GatewayWorker\BusinessWorker->run()
#8 /www/wwwroot/Route2/vendor/workerman/workerman/Worker.php(1383): Workerman\Worker::forkOneWorkerForLinux()
#9 /www/wwwroot/Route2/vendor/workerman/workerman/Worker.php(1357): Workerman\Worker::forkWorkersForLinux()
#10 /www/wwwroot/Route2/vendor/workerman/workerman/Worker.php(549): Workerman\Worker::forkWorkers()
#11 /www/wwwroot/Route2/start.php(37): Workerman\Worker::runAll()
#12 {main}
1346 2 0
2个回答

黑老怪

event,linux优化,Register内外端口也都是通的

  • 暂无评论
walkor 打赏

执行 php start.php status 看下172.31.18.200 这台服务器是不是没装event扩展,没装的话装下。
如果不是扩展的原因可能是因为linux内核没有按照手册 https://www.workerman.net/doc/workerman/appendices/kernel-optimization.html 优化
如果还有问题尝试关闭下 172.31.18.200 的iptables(有开启的话),有时iptables跟踪表满了也会导致超时。
还有一种情况是172.31.18.200这台服务器负载高,导致什么都慢。

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