You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RedisClusterClient has poor performance in high concurrency scenarios.
Beacuase RedisClusterClient sends CLUSTER SLOTS to endpoints[0] for slots query every time it call connect()
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
@Override
public Future<RedisConnection> connect() {
final Promise<RedisConnection> promise = vertx.promise();
// attempt to load the slots from the first good endpoint
connect(options.getEndpoints(), 0, promise);
return promise.future();
}
As you can see, CLUSTER SLOTS is an expensive operation. Is it necessary to call CLUSTER 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:
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 connect() once and keep the connection alive for a long period, exactly to avoid the issues you're observing.
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: