Skip to content

Commit 0707e18

Browse files
authored
Merge pull request #218025 from flang-msft/fxl---patch-22
Fxl---Tims patch 22
2 parents ac70449 + 615e5db commit 0707e18

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

articles/azure-cache-for-redis/cache-best-practices-client-libraries.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,55 @@ For information on client library-specific guidance best practices, see the foll
3838
- [Java - Which client should I use?](https://gist.github.com/warrenzhu25/1beb02a09b6afd41dff2c27c53918ce7#file-azure-redis-java-best-practices-md)
3939
- [Lettuce (Java)](https://github.com/Azure/AzureCacheForRedis/blob/main/Lettuce%20Best%20Practices.md)
4040
- [Jedis (Java)](https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f#file-redis-bestpractices-java-jedis-md)
41+
- [Redisson (Java)](cache-best-practices-client-libraries.md#redisson-java)
4142
- [Node.js](https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f#file-redis-bestpractices-node-js-md)
4243
- [PHP](https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f#file-redis-bestpractices-php-md)
4344
- [HiRedisCluster](https://github.com/Azure/AzureCacheForRedis/blob/main/HiRedisCluster%20Best%20Practices.md)
4445
- [ASP.NET Session State Provider](https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f#file-redis-bestpractices-session-state-provider-md)
4546

47+
## Redisson (Java)
48+
49+
We _recommend_ you use redisson 3.14.1 or higher. Older versions contain known connection leak issues that cause problems after failovers. Monitor the Redisson changelog for other known issues can affect features used by your application. For more information, see[`CHANGELOG`](https://github.com/redisson/redisson/blob/master/CHANGELOG.md) and the [Redisson FAQ](https://github.com/redisson/redisson/wiki/16.-FAQ).
50+
51+
Other notes:
52+
53+
- Redisson defaults to 'read from replica' strategy, unlike some other clients. To change this, modify the 'readMode' config setting.
54+
- Redisson has a connection pooling strategy with configurable minimum and maximum settings, and the default minimum values are large. The large defaults could contribute to aggressive reconnect behaviors or 'connection storms'. To reduce the risk, consider using fewer connections because you can efficiently pipeline commands, or batches of commands, over a few connections.
55+
- Redisson has a default idle connection timeout of 10 seconds, which leads to more closing and reopening of connections than ideal.
56+
57+
Here's a recommended baseline configuration for cluster mode that you can modify as needed:
58+
59+
```yml
60+
clusterServersConfig:
61+
idleConnectionTimeout: 30000
62+
connectTimeout: 15000
63+
timeout: 5000
64+
retryAttempts: 3
65+
retryInterval: 3000
66+
failedSlaveReconnectionInterval: 15000
67+
failedSlaveCheckInterval: 60000
68+
subscriptionsPerConnection: 5
69+
clientName: "redisson"
70+
loadBalancer: !<org.redisson.connection.balancer.RoundRobinLoadBalancer> {}
71+
subscriptionConnectionMinimumIdleSize: 1
72+
subscriptionConnectionPoolSize: 50
73+
slaveConnectionMinimumIdleSize: 2
74+
slaveConnectionPoolSize: 24
75+
masterConnectionMinimumIdleSize: 2
76+
masterConnectionPoolSize: 24
77+
readMode: "MASTER"
78+
subscriptionMode: "MASTER"
79+
nodeAddresses:
80+
- "redis://mycacheaddress:6380"
81+
scanInterval: 1000
82+
pingConnectionInterval: 60000
83+
keepAlive: false
84+
tcpNoDelay: true
85+
```
86+
4687
## How to use client libraries
4788
48-
Besides the reference documentation, you can find tutorials showing how to get started with Azure Cache for Redis using different languages and cache clients.
89+
Besides the reference documentation, you can find tutorials showing how to get started with Azure Cache for Redis using different languages and cache clients.
4990
5091
For more information on using some of these client libraries in tutorials, see the following articles:
5192

0 commit comments

Comments
 (0)