You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "aiden-sun (via GitHub)" <gi...@apache.org> on 2025/03/14 03:19:27 UTC

[I] Potential Bug in Smart Loading: numBalancerThreads Calculation When Server CPU Count Exceeds 200 (druid)

aiden-sun opened a new issue, #17801:
URL: https://github.com/apache/druid/issues/17801

   ### Affected Version
   
   Apache Druid version:31.00-32.00
   
   ### Description
   We have encountered an issue with the smart loading mechanism in Apache Druid, specifically related to the calculation of numBalancerThreads when the server has a high CPU count (e.g., exceeding 200 CPUs).
   
   Cluster Size:
   CPU count per server: > 200
   Configurations in Use:smartSegmentLoading=true
   
   Steps to Reproduce the Problem:
   Deploy Apache Druid on a server with more than 200 CPUs, ensuring that the smartSegmentLoading configuration is set to true.
   Initiate a data balancing operation.
   Observe the calculation of numBalancerThreads in the logs.
   Error Message:
   `java.lang.IllegalArgumentException: Number of balancer threads must be in range (0, 100].`
   Observed Behavior:
   When the server's CPU count exceeds 200, Druid calculates numBalancerThreads as CPU count / 2. However, this value exceeds the allowed range of (0, 100], resulting in the above exception. This prevents the data balancing operation from proceeding successfully.
   Additional Source Code:
   `return Math.max(1, JvmUtils.getRuntimeInfo().getAvailableProcessors() / 2)`
   Proposed Solution:
   Remove the hard-coded upper limit of 100 for numBalancerThreads or make it configurable, allowing it to scale dynamically based on the server's CPU count. This would ensure compatibility with high-CPU environments and prevent the exception.


-- 
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@druid.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [I] Potential Bug in Smart Loading: numBalancerThreads Calculation When Server CPU Count Exceeds 200 (druid)

Posted by "gianm (via GitHub)" <gi...@apache.org>.
gianm closed issue #17801: Potential Bug in Smart Loading: numBalancerThreads Calculation When Server CPU Count Exceeds 200
URL: https://github.com/apache/druid/issues/17801


-- 
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@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [I] Potential Bug in Smart Loading: numBalancerThreads Calculation When Server CPU Count Exceeds 200 (druid)

Posted by "gianm (via GitHub)" <gi...@apache.org>.
gianm commented on issue #17801:
URL: https://github.com/apache/druid/issues/17801#issuecomment-2768933300

   Thank you for your bug report. I raised a PR #17855 to cap the number of balancer threads for smart loading at 100.
   
   Btw, if you like, you can work around this by setting `-XX:ActiveProcessorCount=N` on the Coordinator command line to limit the number of processors detected by the JVM.


-- 
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@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org