Hi Daniel,
Greetings!
We would like to inform you that, managing connection timeouts with Azure Managed Redis and the OSS clustering policy can be challenging due to the single endpoint provided by Azure.
Here are some insights and suggestions to help you handle this setup efficiently:
- Retry Logic: Your current retry logic using ExponentialBackoff and Retry is a good start. Ensure that your retry settings are appropriately configured to handle transient errors.
- Health Checks: Setting health_check_interval=30 is beneficial. You might want to adjust this interval based on your application's tolerance for downtime and the expected frequency of node failures.
- Error Handling: Since Azure Managed Redis provides a single endpoint, handling connection errors and proxying to replica nodes manually is necessary. You can use the CLUSTER NODES command to get the list of nodes and their statuses. This will help you identify available nodes and reconfigure your client accordingly.
- Timeout Settings: Configure appropriate connect and command timeouts. A connect timeout of around 5 seconds is recommended.
- Force Reconnect: Implement a mechanism to force reconnect in case of persistent connection issues. This can be done using a singleton pattern for your Redis connection and periodically forcing a reconnect.
- Monitoring and Alerts: Set up monitoring and alerts to detect and respond to connection issues promptly. Azure provides various metrics and logs that can help you track the health of your Redis instances.
We would like to inform you that, since Azure Managed Redis offers two choices for clustering policy: OSS and Enterprise. OSS cluster policy is recommended for most applications because it supports higher maximum throughput, but there are advantages and disadvantages to each version. Please refer to this document https://learn.microsoft.com/en-us/azure/redis/architecture
Note: Azure Managed Redis in the preview feature, there may be certain bugs or limitations that do not exist in the stable version.
Please refer to the below mentioned link for more information.
https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/quickstart-create-redis-enterprise
https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-best-practices-enterprise-tiers
https://learn.microsoft.com/en-us/azure/redis/best-practices-connection
https://learn.microsoft.com/en-us/azure/redis/troubleshoot-timeouts
I hope this information helps. Please do let us know if you have any further queries.
If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.