You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "cfmcgrady (via GitHub)" <gi...@apache.org> on 2024/11/19 12:41:12 UTC
[PR] [CELEBORN-1485] Refactor addCounter, addGauge and addTimer of AbstractSource to reduce CPU utilization [celeborn]
cfmcgrady opened a new pull request, #2928:
URL: https://github.com/apache/celeborn/pull/2928
backport https://github.com/apache/celeborn/pull/2593 to branch-0.4
### What changes were proposed in this pull request?
Refactor `addCounter`, `addGauge` and `addTimer` of `AbstractSource` to reduce CPU utilization.
### Why are the changes needed?
`addCounter`, `addGauge` and `addTimer` of `AbstractSource` checks whether the metric key exist via `MetricRegistry#getMetrics` which iterates all metrics and put into map at present. It causes that adding counter of active connection count metric for application dimension would increase high CPU utilization when there are many active connections:
<img width="1350" alt="image" src="https://github.com/apache/celeborn/assets/10048174/cc882fac-eec1-417b-ba17-f3012053c6c7">
The implementation of `MetricRegistry#getMetrics` is as follows:
```
private <T extends Metric> SortedMap<String, T> getMetrics(Class<T> klass, MetricFilter filter) {
final TreeMap<String, T> timers = new TreeMap<>();
for (Map.Entry<String, Metric> entry : metrics.entrySet()) {
if (klass.isInstance(entry.getValue()) && filter.matches(entry.getKey(), entry.getValue())) {
timers.put(entry.getKey(), (T) entry.getValue());
}
}
return Collections.unmodifiableSortedMap(timers);
}
```
Refactor `addCounter`, `addGauge` and `addTimer` of `AbstractSource` to reduce CPU utilization.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Cluster test.
<img width="1345" alt="image" src="https://github.com/apache/celeborn/assets/10048174/4c0a7f92-3cc5-45f8-941f-e1d0166043e1">
Closes #2593 from SteNicholas/CELEBORN-1485.
Authored-by: SteNicholas <pr...@163.com>
--
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: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1485][0.4] Refactor addCounter, addGauge and addTimer of AbstractSource to reduce CPU utilization [celeborn]
Posted by "cfmcgrady (via GitHub)" <gi...@apache.org>.
cfmcgrady commented on PR #2928:
URL: https://github.com/apache/celeborn/pull/2928#issuecomment-2487277448
cc @SteNicholas @FMX
--
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: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1485][0.4] Refactor addCounter, addGauge and addTimer of AbstractSource to reduce CPU utilization [celeborn]
Posted by "cfmcgrady (via GitHub)" <gi...@apache.org>.
cfmcgrady closed pull request #2928: [CELEBORN-1485][0.4] Refactor addCounter, addGauge and addTimer of AbstractSource to reduce CPU utilization
URL: https://github.com/apache/celeborn/pull/2928
--
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: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1485][0.4] Refactor addCounter, addGauge and addTimer of AbstractSource to reduce CPU utilization [celeborn]
Posted by "cfmcgrady (via GitHub)" <gi...@apache.org>.
cfmcgrady commented on PR #2928:
URL: https://github.com/apache/celeborn/pull/2928#issuecomment-2487316725
thanks, merging to branch-0.4(v0.4.3).
--
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: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org