请教一下,这种错误一般怎么处理?
原来在一台服务器上部署没有出现过这种问题,把businessworker部署到局域网上后,偶尔会出现以下错误退出。
是因为Gateway太忙了吗?
谢谢!
2019-03-08 21:56:46 pid:32583 Worker process terminated2019-03-08 21:56:46 pid:32577 worker exit with status 64000
2019-03-08 21:56:50 pid:3726 Exception: can not connect to tcp://192.168.9.160:7004 Operation now in progress in /var/www/server/vendor/workerman/gateway-worker/src/Lib/Gateway.php:1143
Stack trace:
#0 /var/www/server/vendor/workerman/gateway-worker/src/Lib/Gateway.php(1092): GatewayWorker\Lib\Gateway::sendAndRecv('192.168.9.160:7...', Array)
#1 /var/www/server/vendor/workerman/gateway-worker/src/BusinessWorker.php(378): GatewayWorker\Lib\Gateway::getSession('c0a809a01b5c000...')
#2 : GatewayWorker\BusinessWorker->onGatewayMessage(Object(Workerman\Connection\AsyncTcpConnection), Array)
#3 /var/www/server/vendor/workerman/workerman/Connection/TcpConnection.php(658): call_user_func(Array, Object(Workerman\Connection\AsyncTcpConnection), Array)
#4 : Workerman\Connection\TcpConnection->baseRead(Resource id #6994, 2, Resource id #6994)
#5 /var/www/server/vendor/workerman/workerman/Events/Event.php(195): EventBase->loop()
#6 /var/www/server/vendor/workerman/workerman/Worker.php(2321): Workerman\Events\Event->loop()
#7 /var/www/server/vendor/workerman/gateway-worker/src/BusinessWorker.php(197): Workerman\Worker->run()
#8 /var/www/server/vendor/workerman/workerman/Worker.php(1452): GatewayWorker\BusinessWorker->run()
#9 /var/www/server/vendor/workerman/workerman/Worker.php(1282): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\BusinessWorker))
#10 /var/www/server/vendor/workerman/workerman/Worker.php(1256): Workerman\Worker::forkWorkersForLinux()
#11 /var/www/server/vendor/workerman/workerman/Worker.php(1586): Workerman\Worker::forkWorkers()
#12 /var/www/server/vendor/workerman/workerman/Worker.php(1535): Workerman\Worker::monitorWorkersForLinux()
#13 /var/www/server/vendor/workerman/workerman/Worker.php(509): Workerman\Worker::monitorWorkers()
#14 /var/www/server/start.php(45): Workerman\Worker::runAll()
#15 {main}
2019-03-08 21:56:50 pid:3726 Worker process terminated
2019-03-08 21:56:50 pid:32577 worker exit with status 64000
报错的时候看下各个服务器的负载是不是高了。有可能是负载高了导致。
另外每台服务器都要装event扩展,并按照手册 http://doc.workerman.net/appendices/kernel-optimization.html 优化linux内核。一般普通内核配置不优化无法承载高并发。
都安装有扩展,Gateway的主机安装的libevent, business主机装的event,内核也优化过。
但是优化内核时这一条好像有问题
sysctl: cannot stat /proc/sys/net/ipv4/tcp_tw_recycle: No such file or directory
不知道影响不影响。
另外在开business主机上开status -d 才出现这样的错误,不开就不会出。看错提示里有
12 /var/www/server/vendor/workerman/workerman/Worker.php(1535): Workerman\Worker::monitorWorkersForLinux()
13 /var/www/server/vendor/workerman/workerman/Worker.php(509): Workerman\Worker::monitorWorkers()
估计跟状态实时查看有关系。
Gateway主机是有外网的,businessworker主机没有外网的,我是通过Gateway主机,ssh到business主机上开的status -d
其实,这个错误也影响不大,只是想提供一些线索,供大家参考。
我也遇到这种情况,不知道怎么解决。
也装了扩展,内核也优化了,还是时不时的报这个错误,也没有规律