diff --git a/src/main/kotlin/mdnet/base/Application.kt b/src/main/kotlin/mdnet/base/Application.kt index d270e45..a5e771f 100644 --- a/src/main/kotlin/mdnet/base/Application.kt +++ b/src/main/kotlin/mdnet/base/Application.kt @@ -39,7 +39,7 @@ import javax.crypto.CipherOutputStream import javax.crypto.spec.SecretKeySpec private val LOGGER = LoggerFactory.getLogger("Application") -private val THREADS_TO_ALLOCATE = Runtime.getRuntime().availableProcessors() * 30 / 2 +private val THREADS_TO_ALLOCATE = Runtime.getRuntime().availableProcessors() * 30 fun getServer(cache: DiskLruCache, serverSettings: ServerSettings, clientSettings: ClientSettings, statistics: AtomicReference): Http4kServer { val executor = Executors.newCachedThreadPool() diff --git a/src/main/kotlin/mdnet/base/Netty.kt b/src/main/kotlin/mdnet/base/Netty.kt index 2cbde77..2846c92 100644 --- a/src/main/kotlin/mdnet/base/Netty.kt +++ b/src/main/kotlin/mdnet/base/Netty.kt @@ -38,8 +38,8 @@ private val LOGGER = LoggerFactory.getLogger("Application") class Netty(private val tls: ServerSettings.TlsCert, private val clientSettings: ClientSettings, private val stats: AtomicReference) : ServerConfig { override fun toServer(httpHandler: HttpHandler): Http4kServer = object : Http4kServer { - private val masterGroup = NioEventLoopGroup() - private val workerGroup = NioEventLoopGroup() + private val masterGroup = NioEventLoopGroup(Runtime.getRuntime().availableProcessors() * 30 / 2) + private val workerGroup = NioEventLoopGroup(Runtime.getRuntime().availableProcessors() * 30 / 2) private lateinit var closeFuture: ChannelFuture private lateinit var address: InetSocketAddress