This is an automated email from the ASF dual-hosted git repository.
xiangfu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 8c2cefb4d5 Set conservative default for gRPC query sever worker thread
count (#15676)
8c2cefb4d5 is described below
commit 8c2cefb4d582d8f4da31eea75188d7a0ede0dba9
Author: Songqiao Su <[email protected]>
AuthorDate: Wed Apr 30 19:14:52 2025 -0700
Set conservative default for gRPC query sever worker thread count (#15676)
* shrink default size
* address comment
---
.../java/org/apache/pinot/core/transport/grpc/GrpcQueryServer.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/pinot-core/src/main/java/org/apache/pinot/core/transport/grpc/GrpcQueryServer.java
b/pinot-core/src/main/java/org/apache/pinot/core/transport/grpc/GrpcQueryServer.java
index 3ece458708..628d7a283a 100644
---
a/pinot-core/src/main/java/org/apache/pinot/core/transport/grpc/GrpcQueryServer.java
+++
b/pinot-core/src/main/java/org/apache/pinot/core/transport/grpc/GrpcQueryServer.java
@@ -65,7 +65,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
// TODO: Plug in QueryScheduler
public class GrpcQueryServer extends
PinotQueryServerGrpc.PinotQueryServerImplBase {
private static final Logger LOGGER =
LoggerFactory.getLogger(GrpcQueryServer.class);
@@ -74,6 +73,9 @@ public class GrpcQueryServer extends
PinotQueryServerGrpc.PinotQueryServerImplBa
// hashCode changes and the map is resized, the SslContext of the old
hashCode will be lost.
private static final Map<Integer, SslContext> SERVER_SSL_CONTEXTS_CACHE =
new ConcurrentHashMap<>();
+ private static final int DEFAULT_GRPC_QUERY_WORKER_THREAD =
+ Math.max(2, Math.min(8, ResourceManager.DEFAULT_QUERY_WORKER_THREADS));
+
private final QueryExecutor _queryExecutor;
private final ServerMetrics _serverMetrics;
private final Server _server;
@@ -107,7 +109,7 @@ public class GrpcQueryServer extends
PinotQueryServerGrpc.PinotQueryServerImplBa
_executorService = QueryThreadContext.contextAwareExecutorService(
Executors.newFixedThreadPool(config.isQueryWorkerThreadsSet()
? config.getQueryWorkerThreads()
- : ResourceManager.DEFAULT_QUERY_WORKER_THREADS)
+ : DEFAULT_GRPC_QUERY_WORKER_THREAD)
);
_queryExecutor = queryExecutor;
_serverMetrics = serverMetrics;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]