apache / apache/servicecomb-java-chassis
[BUG] - 频繁获取不存在配置导致性能劣化
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 814
- Avg merge
- 8d 23h
- Merged PRs (30d)
- 1
Description
### Steps to Reproduce
servicecomb3.2.2版本问题,性能劣化,火焰图分析:
org.apache.servicecomb.router.custom.RouterServerListFilter#enabled,
org.apache.servicecomb.loadbalance.LoadBalanceFilter#getOrCreateLoadBalancer调用org.apache.servicecomb.loadbalance.Configuration#getRuleStrategyName,
org.apache.servicecomb.loadbalance.filter.ZoneAwareDiscoveryFilter#enabled,
org.apache.servicecomb.registry.discovery.InstanceStatusDiscoveryFilter#enabled,
org.apache.servicecomb.core.invocation.InvocationFactory#setSrcMicroservice调用readServiceName(),每次consumer调用都要重复去spring获取上面五个属性,导致consumer操作CPU消耗比2.X多近10倍
### Expected Behavior
_No response_
### Servicecomb Version
_No response_
### Additional Context
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the per-call paths through RouterServerListFilter#enabled, LoadBalanceFilter#getOrCreateLoadBalancer, Configuration#getRuleStrategyName, ZoneAwareDiscoveryFilter#enabled, InstanceStatusDiscoveryFilter#enabled, and InvocationFactory#setSrcMicroservice/readServiceName. Use profiling or focused tests to verify whether the five properties are repeatedly fetched from Spring. Done means the reported consumer CPU regression is addressed and the affected behavior remains covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100