mayankshriv commented on a change in pull request #4773: Enhance CombineOperator
URL: https://github.com/apache/incubator-pinot/pull/4773#discussion_r342736146
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/operator/CombineOperator.java
 ##########
 @@ -47,22 +45,16 @@
   private static final Logger LOGGER = 
LoggerFactory.getLogger(CombineOperator.class);
   private static final String OPERATOR_NAME = "CombineOperator";
 
+  // Use at most 10 or half of the processors threads for each query.
+  // If there are less than 2 processors, use 1 thread.
+  // Runtime.getRuntime().availableProcessors() may return value < 2 in 
container based environment, e.g. Kubernetes.
+  private static final int MAX_NUM_THREADS_PER_QUERY =
+      Math.max(1, Math.min(10, Runtime.getRuntime().availableProcessors() / 
2));
 
 Review comment:
   Will `Runtime.getRuntime().availableProcessors()` still work accurately on 
cloud VM's (say Azure)? Also, what about when there's cgroups limits imposed?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to