Make Netty naive-multithreaded too
Hopefully we can replace this that intelligently scales to a user setting next time...
This commit is contained in:
parent
5dbe29c8e9
commit
da47b86d97
|
@ -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<Statistics>): Http4kServer {
|
||||
val executor = Executors.newCachedThreadPool()
|
||||
|
|
|
@ -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<Statistics>) : 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
|
||||
|
||||
|
|
Loading…
Reference in a new issue