Skip to content

Conversation

@TheLevti
Copy link
Contributor

@TheLevti TheLevti commented Jan 14, 2025

This pull request adds support for the phpredis backoff/retry configs.

Those settings are crucial for high performance applications. Currently I am forced to overwrite the driver in many services to leverage those configs. It would be amazing if you can merge this to support those configs out of the box.

I have confirmed with the phpredis maintainer, that those settings are currently only available to the normal Redis class, not for RedisCluster yet, so I did not add them to the cluster setup.

Reasoning

This has been added to phpredis by recommendation from an AWS blog post: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/

Especially when using phpredis with AWS Serverless where auto scaling constantly drops connections, it is important to spread out the reconnect attempts. The default phpredis is a linear backoff approach, which is not ideal.

@taylorotwell taylorotwell merged commit 0b6d699 into laravel:11.x Jan 15, 2025
40 checks passed
@TheLevti TheLevti deleted the feature/phpredis-backoff-algorithm branch January 15, 2025 20:52
TheLevti added a commit to TheLevti/docs that referenced this pull request Jan 15, 2025
Mention the newly added phpredis config options that users are able to specify (see: laravel/framework#54191)
taylorotwell pushed a commit to laravel/docs that referenced this pull request Jan 15, 2025
Mention the newly added phpredis config options that users are able to specify (see: laravel/framework#54191)
@Tklaversma
Copy link

Shouldn't we add the default values to the actual config file, so people can see those and adjust accordingly?

@TheLevti
Copy link
Contributor Author

TheLevti commented Jan 22, 2025

Shouldn't we add the default values to the actual config file, so people can see those and adjust accordingly?

Default is those values are not set at all. You can of course add the values that indicate disabled, but that is just unecessary work with no effect. Besides, not every setup has the Redis extension installed and that would lead to referencing unknown constants.

Those options are stated in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants