From 226674541c5a1c8ba88b9e7014864764ff472b07 Mon Sep 17 00:00:00 2001 From: joshua bauer Date: Wed, 26 Apr 2017 16:06:19 -0700 Subject: [PATCH] Server tuning. --- .../java/io/sinistral/proteus/Application.java | 17 +++++++---------- src/main/resources/reference.conf | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/java/io/sinistral/proteus/Application.java b/src/main/java/io/sinistral/proteus/Application.java index 7b0c510..0b2852d 100644 --- a/src/main/java/io/sinistral/proteus/Application.java +++ b/src/main/java/io/sinistral/proteus/Application.java @@ -196,18 +196,15 @@ public Undertow buildServer() undertow = Undertow.builder() .addHttpListener(config.getInt("application.port"),config.getString("application.host")) - .setBufferSize(config.getBytes("undertow.bufferSize").intValue()) - .setIoThreads(config.getInt("undertow.ioThreads")) - .setServerOption(UndertowOptions.ENABLE_HTTP2, config.getBoolean("undertow.server.enableHttp2")) + .setBufferSize(16 * 1024) + .setIoThreads( config.getInt("undertow.ioThreads") ) + .setServerOption(UndertowOptions.ENABLE_HTTP2, true) .setServerOption(UndertowOptions.ALWAYS_SET_DATE, true) - .setServerOption(UndertowOptions.BUFFER_PIPELINED_DATA, config.getBoolean("undertow.server.bufferPipelinedData")) - .setSocketOption(org.xnio.Options.BACKLOG, config.getInt("undertow.socket.backlog")) - .setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, config.getBoolean("undertow.server.alwaysSetKeepAlive")) - .setServerOption(UndertowOptions.RECORD_REQUEST_START_TIME, config.getBoolean("undertow.server.recordRequestStartTime")) + .setSocketOption(org.xnio.Options.BACKLOG, config.getInt("undertow.socket.backlog") ) + .setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false) + .setServerOption(UndertowOptions.RECORD_REQUEST_START_TIME, false) .setServerOption(UndertowOptions.MAX_ENTITY_SIZE, config.getBytes("undertow.server.maxEntitySize") ) - .setWorkerThreads(config.getInt("undertow.workerThreads")) - .setDirectBuffers( config.getBoolean("undertow.directBuffers")) - + .setWorkerThreads( config.getInt("undertow.workerThreads") ) .setHandler( handler ) .build(); diff --git a/src/main/resources/reference.conf b/src/main/resources/reference.conf index ebe9c56..2a1c63d 100644 --- a/src/main/resources/reference.conf +++ b/src/main/resources/reference.conf @@ -85,7 +85,7 @@ undertow backlog = 10000 } # x AvailableProcessors - ioThreads = 12 + ioThreads = 16 workerThreads = 200 bufferSize = 16K directBuffers = true