You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/06/28 09:14:58 UTC

[GitHub] [dubbo] tietang opened a new issue, #10227: When using the Redis registry and Redis Cluster, the first call is very slow

tietang opened a new issue, #10227:
URL: https://github.com/apache/dubbo/issues/10227

    使用redis注册中心,且redis集群是cluster模式时,泛化调用,第一次调用非常慢,都在5~10秒,当工程中有较多reference时,启动也很慢(redis 集群共6个实例)。
   经过排查,时间主要花费在了redis 集群scan命令上:
   org.apache.dubbo.registry.redis.RedisRegistry#doSubscribe  269行 `大部分时间都花费在了`redisClient.scan(service + PATH_SEPARATOR + ANY_VALUE)`这行代码上,进一步排查为scan命令耗时严重。
   
   这一行代码的目的是查询出某个interface的provider和consumers key,是否可以通过组装查询是否存在来进行判断呢?代码如下:
   
   
   ```
                  Set<String> keys = new HashSet<>();//redisClient.scan(service + PATH_SEPARATOR + ANY_VALUE);
                   String keyProviders = service + PATH_SEPARATOR + PROVIDERS_CATEGORY;
                   boolean existsProviders = redisClient.exists(keyProviders);
                   if (existsProviders) {
                       keys.add(keyProviders);
                   }
                   String keyConsumers = service + PATH_SEPARATOR + CONSUMERS_CATEGORY;
                   boolean existsConsumers = redisClient.exists(keyConsumers);
                   if (existsConsumers) {
                       keys.add(keyConsumers);
                   }
                   doNotify(keys, url, Collections.singletonList(listener));
   ```
   
   
   
   ### Environment
   
   * Dubbo version:  2.7.15
   * Operating System version: xxx
   * Java version: xxx
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10227: When using the Redis registry and Redis Cluster, the first call is very slow

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10227:
URL: https://github.com/apache/dubbo/issues/10227#issuecomment-1168633585

   你可以把你的优化方案提出来哦,也可以直接提 PR 的


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org