You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "liubao (Jira)" <ji...@apache.org> on 2024/01/03 07:22:00 UTC

[jira] [Closed] (SCB-1576) SerivceCombServerStatus has performance problem

     [ https://issues.apache.org/jira/browse/SCB-1576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

liubao closed SCB-1576.
-----------------------
    Resolution: Fixed

> SerivceCombServerStatus has performance problem
> -----------------------------------------------
>
>                 Key: SCB-1576
>                 URL: https://issues.apache.org/jira/browse/SCB-1576
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Java-Chassis
>    Affects Versions: java-chassis-1.2.1
>            Reporter: jeho0815
>            Assignee: jeho0815
>            Priority: Major
>
> if server has many instance,  the ServiceCombLoadBalancerStats#getServiceCombServer iterate all the instances cache each invoke
> {code:java}
> public ServiceCombServer getServiceCombServer(MicroserviceInstance instance) {
>  for (ServiceCombServer server : serverStatsCache.asMap().keySet()) {
>  if (server.getInstance().equals(instance)) {
>  return server;
>  }
>  }
>  return null;
>  }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)