Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@
* @see https://github.com/predis/predis/wiki/Connection-Parameters
*/
'cluster' => false,
/*
* REDIS_PERSISTENT=true keeps one TLS socket per connection in each php-fpm worker,
* so requests skip the TLS handshake. Every connection needs its own persistent id:
* they share host:port, and a shared socket would let one connection's SELECT
* switch the database of another within the same request. predis takes the id from
* 'persistent', phpredis from 'persistent_id'; both are set so either client is safe.
*/

'default' => [
'host' => env('REDIS_HOST'),
Expand All @@ -110,6 +117,8 @@
'password' => env('REDIS_PASSWORD'),
'timeout' => env('REDIS_TIMEOUT', 30.0),
'scheme' => env('REDIS_SCHEME', 'tcp'),
'persistent' => env('REDIS_PERSISTENT', false) ? 'openstackid_default' : false,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
'persistent_id' => 'openstackid_default',
],

'cache' => [
Expand All @@ -119,6 +128,8 @@
'password' => env('REDIS_PASSWORD'),
'timeout' => env('REDIS_TIMEOUT', 30.0),
'scheme' => env('REDIS_SCHEME', 'tcp'),
'persistent' => env('REDIS_PERSISTENT', false) ? 'openstackid_cache' : false,
'persistent_id' => 'openstackid_cache',
],

'session' => [
Expand All @@ -128,6 +139,8 @@
'password' => env('REDIS_PASSWORD'),
'timeout' => env('REDIS_TIMEOUT', 30.0),
'scheme' => env('REDIS_SCHEME', 'tcp'),
'persistent' => env('REDIS_PERSISTENT', false) ? 'openstackid_session' : false,
'persistent_id' => 'openstackid_session',
],

'worker' => [
Expand All @@ -137,6 +150,8 @@
'password' => env('REDIS_PASSWORD'),
'timeout' => env('REDIS_TIMEOUT', 30.0),
'scheme' => env('REDIS_SCHEME', 'tcp'),
'persistent' => env('REDIS_PERSISTENT', false) ? 'openstackid_worker' : false,
'persistent_id' => 'openstackid_worker',
],
'doctrine_cache' => [
'host' => env('REDIS_HOST'),
Expand All @@ -145,6 +160,8 @@
'password' => env('REDIS_PASSWORD'),
'timeout' => env('REDIS_TIMEOUT', 30.0),
'scheme' => env('REDIS_SCHEME', 'tcp'),
'persistent' => env('REDIS_PERSISTENT', false) ? 'openstackid_doctrine_cache' : false,
'persistent_id' => 'openstackid_doctrine_cache',
],
],
'allow_disabled_pk' => env('ALLOW_DISABLED_PK', false),
Expand Down
Loading