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

[opt] improve the tps of registerInstance interface #1458

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

tornado-ssy
Copy link
Contributor

No description provided.

@tornado-ssy
Copy link
Contributor Author

tornado-ssy commented Mar 15, 2024

背景:2w实例场景下,sc注册实例接口tps未达标(目标tps 2000/s,当前tps1500/s),经分析,注册实例时查询已注册实例的数量中的getPrefixKey递归方法是性能瓶颈。
优化:key中“/”的数量为6时,该key表示一个domian和project的组合(可以称之为租户根目录),可以使用一个map来维护租户根目录与该目录下叶子节点数量。这样查询租户根目录节点的时,会把递归查叶子节点数量的时间成本,分摊到每次叶子节点发生变化的操作上(addpredixkey,deleteprefixkey),且这两个操作又是由listandwatch方法异步触发的,进一步分摊了成本。

@little-cui little-cui merged commit a6ef87c into apache:dev Mar 16, 2024
8 checks passed
tornado-ssy pushed a commit to tornado-ssy/servicecomb-service-center that referenced this pull request Apr 15, 2024
little-cui pushed a commit that referenced this pull request Apr 15, 2024
…f registry instance (#1469)

* [feat] if the console show the dns name, then do not need port

* Revert "[opt] improve the tps of registerInstance interface (#1458)"

This reverts commit a6ef87c.

---------

Co-authored-by: songshiyuan 00649746 <songshiyuan3@huawei.com>
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.

2 participants