From e580f803849a1de7e93f5fec6a9154aa699b0e84 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Thu, 26 Sep 2024 23:55:20 +0200 Subject: [PATCH] Multi-core event loop group --- .../java/it/cavallium/rockserver/core/server/GrpcServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/it/cavallium/rockserver/core/server/GrpcServer.java b/src/main/java/it/cavallium/rockserver/core/server/GrpcServer.java index 5007e3c..b1ca050 100644 --- a/src/main/java/it/cavallium/rockserver/core/server/GrpcServer.java +++ b/src/main/java/it/cavallium/rockserver/core/server/GrpcServer.java @@ -71,7 +71,7 @@ public class GrpcServer extends Server { EventLoopGroup elg; Class channelType; try { - elg = new EpollEventLoopGroup(1); + elg = new EpollEventLoopGroup(Math.min(8, Runtime.getRuntime().availableProcessors())); channelType = EpollServerDomainSocketChannel.class; } catch (UnsatisfiedLinkError ex) { elg = new NioEventLoopGroup();