Skip to content

Commit

Permalink
Server tuning.
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Apr 26, 2017
1 parent 4a1be18 commit 2266745
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
17 changes: 7 additions & 10 deletions src/main/java/io/sinistral/proteus/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ undertow
backlog = 10000
}
# x AvailableProcessors
ioThreads = 12
ioThreads = 16
workerThreads = 200
bufferSize = 16K
directBuffers = true
Expand Down

0 comments on commit 2266745

Please sign in to comment.