From 144f967dbfd6596fa089962e0a23aa7fdad3e473 Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Wed, 28 Feb 2024 16:23:02 +0100 Subject: [PATCH] (misc) Tweak pool sizes --- .../nu/marginalia/service/client/GrpcChannelPoolFactory.java | 4 ++-- .../service/java/nu/marginalia/service/server/Service.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/common/service-discovery/java/nu/marginalia/service/client/GrpcChannelPoolFactory.java b/code/common/service-discovery/java/nu/marginalia/service/client/GrpcChannelPoolFactory.java index 08dbb41d..57e72fa6 100644 --- a/code/common/service-discovery/java/nu/marginalia/service/client/GrpcChannelPoolFactory.java +++ b/code/common/service-discovery/java/nu/marginalia/service/client/GrpcChannelPoolFactory.java @@ -21,9 +21,9 @@ public class GrpcChannelPoolFactory { private final NodeConfigurationWatcher nodeConfigurationWatcher; private final ServiceRegistryIf serviceRegistryIf; private static final Executor executor = NamedExecutorFactory.createFixed("gRPC-Channel-Pool", - Math.clamp(Runtime.getRuntime().availableProcessors() / 2, 2, 16)); + Math.clamp(Runtime.getRuntime().availableProcessors() / 2, 2, 32)); private static final Executor offloadExecutor = NamedExecutorFactory.createFixed("gRPC-Offload-Pool", - Math.clamp(Runtime.getRuntime().availableProcessors() / 2, 2, 16)); + Math.clamp(Runtime.getRuntime().availableProcessors() / 2, 2, 32)); @Inject public GrpcChannelPoolFactory(NodeConfigurationWatcher nodeConfigurationWatcher, diff --git a/code/common/service/java/nu/marginalia/service/server/Service.java b/code/common/service/java/nu/marginalia/service/server/Service.java index f4f51375..040e9258 100644 --- a/code/common/service/java/nu/marginalia/service/server/Service.java +++ b/code/common/service/java/nu/marginalia/service/server/Service.java @@ -137,7 +137,7 @@ public class Service { int port = params.serviceRegistry.requestPort(config.externalAddress(), new ServiceKey.Grpc<>("-", partition)); - int nThreads = Math.clamp(Runtime.getRuntime().availableProcessors() / 2, 2, 8); + int nThreads = Math.clamp(Runtime.getRuntime().availableProcessors() / 2, 2, 16); // Start the gRPC server var grpcServerBuilder = NettyServerBuilder.forAddress(new InetSocketAddress(config.bindAddress(), port))