laravel-phpredis
laravel-phpredis copied to clipboard
Connection timed out
we use phpredis in our laravel project and we use redis frequency,sometimes the following problems occur:(9 error in one second) [2017-07-04 09:55:55] local.ERROR: exception 'ErrorException' with message 'Redis::connect(): connect() failed: Connection timed out' in /home/www/xiang5APP/vendor/vetruvet/laravel-phpredis/src/Vetruvet/PhpRedis/Database.php:95 [2017-07-04 09:55:55] local.ERROR: exception 'ErrorException' with message 'Redis::connect(): connect() failed: Connection timed out' in /home/www/xiang5APP/vendor/vetruvet/laravel-phpredis/src/Vetruvet/PhpRedis/Database.php:95
and our database.php configure is: 'redis' => [
'cluster' => false,
'default' => [
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 10,
'timeout' => 0,
'serializer' => 'none'
],
]
For the first time, please shine more. thank you very much.
have already solve it: add an option config: 'persistent' => 'true' //source code use isset method to check config so save many connection and disconnection, there is no any error report,now in the observation stage.