tornado-ssy commented on PR #1458:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1458#issuecomment-1998747429

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


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to