-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
关于启动时往zookeeper注册的优化 #692
Comments
|
直接简单代码连接zookeeper测试,当节点存在时,创建单个节点(不抛异常的方式)大概40ms,而判断存在只需要3ms。 |
kevin82008 |
每个服务分别创建以下节点各一次 /dubbo/com.alibaba.dubbo.demo.DemoService/consumers
/dubbo/com.alibaba.dubbo.demo.DemoService/providers
/dubbo/com.alibaba.dubbo.demo.DemoService/configurators
/dubbo/com.alibaba.dubbo.demo.DemoService/routers 每个服务能减少3次create重复操作,当服务数量多时还是能缩短一点启动时间 |
@chickenlj 不是减少3次, /dubbo 这一层整个系统只需要创建一次,所以是从原来的创建 4*3=12次, |
* Optimize(AbstractRegistry) registry cache, one registry file per 'registry & application', avoid reload (apache#685). * Fixed apache#692 optimize zookeeper operation in service export/reference process: check already exists before create
目前在启动consumer注册时,每一个暴露的服务需要调用十多次请求往 zookeeper创建节点用于存储 consumer/router/config 等信息,而这十多次调用基本上每次都是无效的(除了第一次调用会真正创建,后面都是不需要的)
可以优化下,启动时应该速度能提升比较多
代码
里面的 create(String path, boolean ephemeral) 递归调用,createPersistent 的时候可以加判断
The text was updated successfully, but these errors were encountered: