Skip to content
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

[feat] supprt search total instances and global instance option #14

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tornado-ssy
Copy link
Contributor

No description provided.

func WithIgnoreLease() OpOption { return func(op *OpOptions) { op.IgnoreLease = true } }
func WithCacheOnly() OpOption { return func(op *OpOptions) { op.Mode = ModeCache } }
func WithNoCache() OpOption { return func(op *OpOptions) { op.Mode = ModeNoCache } }
func WithGlobalInstanceSearch() OpOption {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

说明清楚设计意图

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2w实例下需要优化servicecomb-center注册微服务实例接口性能,经分析,注册实例接口性能主要卡在用递归算法计算当前已使用实例数,优化思路是在cache里维护已注册的所有实例数(包含全局实例数【sc自己】),获取已注册实例数需要用所有实例数-全局实例数,但是全局实例数较难维护,且全局实例数一般数量很少,计算它的实例数用递归也没有什么性能损耗,所以在cache只维护一个count变量表示所有实例数,用这两个选项表示到cache查的是所有注册实例数还是全局实例数。

Copy link

@chengyouling chengyouling Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SC的实例数不是在初始化或者扩容等阶段就固定了吗?SC的实例考虑初始化的时候设定即可,主要是用原子计数考虑微服务实例数,感觉你说的有点复杂啊。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的实例数指的是注册到引擎的微服务实例数,需要实时维护

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants