diff --git a/src/Nethermind/Nethermind.Network/Rlpx/RlpxHost.cs b/src/Nethermind/Nethermind.Network/Rlpx/RlpxHost.cs index 7e9305057df..32bafe6001a 100644 --- a/src/Nethermind/Nethermind.Network/Rlpx/RlpxHost.cs +++ b/src/Nethermind/Nethermind.Network/Rlpx/RlpxHost.cs @@ -20,7 +20,6 @@ using Nethermind.Network.P2P.EventArg; using Nethermind.Network.Rlpx.Handshake; using Nethermind.Stats.Model; -using ILogger = Nethermind.Logging.InterfaceLogger; using LogLevel = DotNetty.Handlers.Logging.LogLevel; namespace Nethermind.Network.Rlpx @@ -105,8 +104,13 @@ public async Task Init() try { - _bossGroup = new MultithreadEventLoopGroup(); - _workerGroup = new MultithreadEventLoopGroup(); + // Default is LogicalCoreCount * 2 + // - so with two groups and 32 logical cores, we would have 128 threads + // Max at 8 threads per group for 16 threads total + // Min of 2 threads per group for 4 threads total + var threads = Math.Clamp(Environment.ProcessorCount / 2, min: 2, max: 8); + _bossGroup = new MultithreadEventLoopGroup(threads); + _workerGroup = new MultithreadEventLoopGroup(threads); ServerBootstrap bootstrap = new(); bootstrap