-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize RedisClusterClient connect operations #306
Comments
Hi @norbald, I think this is a usability issue. We should document that when using vert.x in cluster mode (cluster client) users, should manage their connection. The expectation is that a user would call A second point is that, probably, we should do some random shuffle of the configuration nodes to avoid overloading the “slot” call to always start on the 1st entry, which will put way more load on a single node than the rest. This could be related to #303 as we could create a wrapper that “caches” the connections and in this case we could avoid calling the slots command all the time. |
Describe the feature
RedisClusterClient has poor performance in high concurrency scenarios.
Beacuase RedisClusterClient sends
CLUSTER SLOTS
to endpoints[0] for slots query every time it callconnect()
This will have the following effects:
The
CLUSTER SLOTS
command is issued for each connection to increase the CPU load of the endpoints[0] . In my case, the conventional query command is only 12%-16% cpu usage, the endpoints[0] is slave node with 93% cpu usage. you can see cpu load from following image.if endpoints[0] was a slave node and it was offline, and the redis cluster is working normally, every connection would take 1000ms+(RETRIES = 16 by default) for slots query,
The specific code is in io.vertx.redis.client.impl.RedisClusterClient.java:126
Here are my endpoints[0] commandstats:
As you can see,
CLUSTER SLOTS
is an expensive operation. Is it necessary to callCLUSTER SLOTS
each connection?English is not my mother tongue, I hope I have expressed my views clearly .
Finally, I hope vertx-redis-client will be more reliable in production environment.
Use cases
Make a Vert.x HTTP Server with Redis Cluster and vertx-redis-client,
do some redis operation pressure measurement like
get foo
、incr count
with Apache JMeter.The text was updated successfully, but these errors were encountered: