[11.x] Add support for phpredis backoff and max retry config options #54191
+16
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 forRedisCluster
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.