Skip to content

Commit

Permalink
Default settings optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Apr 26, 2017
1 parent 21ddc86 commit 4a1be18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/main/java/io/sinistral/proteus/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,24 +193,24 @@ public Undertow buildServer()
{
handler = rootHandler;
}

undertow = Undertow.builder()
.addHttpListener(config.getInt("application.port"),config.getString("application.host"))
.setServerOption(UndertowOptions.ENABLE_HTTP2, config.getBoolean("undertow.server.enableHttp2"))
.setServerOption(UndertowOptions.ALWAYS_SET_DATE, config.getBoolean("undertow.server.alwaysSetDate"))
.setBufferSize(config.getBytes("undertow.bufferSize").intValue())
.setIoThreads(config.getInt("undertow.ioThreads"))
.setServerOption(UndertowOptions.ENABLE_HTTP2, config.getBoolean("undertow.server.enableHttp2"))
.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"))
.setServerOption(UndertowOptions.MAX_ENTITY_SIZE, config.getBytes("undertow.server.maxEntitySize") )
.setSocketOption(org.xnio.Options.BACKLOG, config.getInt("undertow.socket.backlog"))
.setWorkerThreads(config.getInt("undertow.workerThreads"))
.setBufferSize(config.getBytes("undertow.bufferSize").intValue())
.setIoThreads(config.getInt("undertow.ioThreads"))
.setDirectBuffers( config.getBoolean("undertow.directBuffers"))

.setHandler( handler )
.build();



return undertow;
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,22 @@ swagger {
undertow
{
server {
enableHttp2 = false
enableHttp2 = true
alwaysSetDate = true
alwaysSetKeepAlive = false
recordRequestStartTime = false
maxEntitySize = 200M
maxEntitySize = 100M
bufferPipelinedData = false
}

socket {
backlog = 10000
}
# x AvailableProcessors
ioThreads = 8
ioThreads = 12
workerThreads = 200
bufferSize = 16K
directBuffers = false
directBuffers = true
}


0 comments on commit 4a1be18

Please sign in to comment.