You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/26 18:47:41 UTC

[GitHub] [pulsar] heesung-sn commented on a diff in pull request #17820: [Bugfix] [LinuxInfoUtils] incorrect CPU usage collected by pulsar #17815

heesung-sn commented on code in PR #17820:
URL: https://github.com/apache/pulsar/pull/17820#discussion_r980387294


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LinuxInfoUtils.java:
##########
@@ -85,6 +86,8 @@ public static double getTotalCpuLimit(boolean isCGroupsEnabled) {
                 if (quota > 0) {
                     return 100.0 * quota / period;
                 }
+                int cpuCount = readTrimStringFromFile(Paths.get(CGROUPS_CPU_USAGE_PER_CPU_PATH)).split(" ").length;

Review Comment:
   Could you provide some references regarding this change?
   
   Though this appears to be a good way to estimate the number of cpus, I wonder if this is the "correct" way to get the max number of CPUs per cgroup.
   
   
   
   



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org