gateway推送數據,使用redis緩存時不時的爆出錯誤:
RedisException: read error on connection in /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/cache/driver/Redis.php:121php
Stack trace: #0 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/cache/driver/Redis.php(121): Redis->setex('cc_table_member...', 18000, 1543818152) #1 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/Cache.php(148): think\cache\driver\Redis->set('table_members_2...', 1543818152, 18000) #2 /data/wwwroot/test2.tigerisa.com/application/push/controller/Events.php(298): think\Cache::set('table_members_2...', 1543818152, 18000) #3 [internal function]: app\push\controller\Events::onClose('7f0000010f3d000...') #4 /data/wwwroot/test2.tigerisa.com/vendor/workerman/gateway-worker/src/BusinessWorker.php(409): call_user_func('\\app\\push\\contr...', '7f0000010f3d000...') #5 [internal function]: GatewayWorker\BusinessWorker->onGatewayMessage(Object(Workerman\Connection\AsyncTcpConnection), Array) #6 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Connection/TcpConnection.php(650): call_user_func(Array, Object(Workerman\Connection\AsyncTcpConnection), Array) #7 [internal function]: Workerman\Connection\TcpConnection->baseRead(Resource id #103) #8 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Events/Select.php(295): call_user_func_array(Array, Array) #9 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Worker.php(2323): Workerman\Events\Select->loop() #10 /data/wwwroot/test2.tigerisa.com/vendor/workerman/gateway-worker/src/BusinessWorker.php(197): Workerman\Worker->run() #11 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Worker.php(1452): GatewayWorker\BusinessWorker->run() #12 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Worker.php(1282): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\BusinessWorker)) #13 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Worker.php(1256): Workerman\Worker::forkWorkersForLinux() #14 /data/wwwroot/test2.tigerisa.com/vendor/workerman/workerman/Worker.php(507): Workerman\Worker::forkWorkers() #15 /data/wwwroot/test2.tigerisa.com/application/push/controller/Run.php(62): Workerman\Worker::runAll() #16 [internal function]: app\push\controller\Run->__construct() #17 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/App.php(359): ReflectionClass->newInstanceArgs(Array) #18 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/Loader.php(479): think\App::invokeClass('app\\push\\contro...') #19 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/App.php(575): think\Loader::controller('run', 'controller', false, 'Error') #20 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/App.php(456): think\App::module(Array, Array, true) #21 /data/wwwroot/test2.tigerisa.com/thinkphp/library/think/App.php(139): think\App::exec(Array, Array) #22 /data/wwwroot/test2.tigerisa.com/thinkphp/start.php(19): think\App::run() #23 /data/wwwroot/test2.tigerisa.com/public/server.php(50): require('/data/wwwroot/t...') #24 {main} Worker[10879] process terminated
致使進程終止。redis
經過百度我作了幾番努力:
一、 設置緩存時間 Cache::set($key,json_encode($value,JSON_UNESCAPED_UNICODE),18000);------------------沒卵用
二、 ini_set('default_socket_timeout', -1); //不超時 設置不超時-------------------------------------驗證中。。。thinkphp