You can specify persistent connections in your Laravel configuration by adding the persistent option to your Redis connection settings in the config/database.php file.
Here's how you can do it:
'redis' => [
'client' => env('REDIS_CLIENT', 'predis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'predis'),
'persistent' => true, // Add this line
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
//...
],
This will make Predis use persistent connections, which should help with the issue you're experiencing. Remember to clear your configuration cache using php artisan config:clear after making changes to your configuration files.