Undertow 属性默认值

Undertow properties default values

我们目前正在调整使用 undertow 的服务,但找不到以下属性的默认值:

server.undertow.worker-threads
server.undertow.io-threads

我们了解到 undertow 在设置线程时使用 org.xnio.Options 但找不到任何默认值。

来自https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/Undertow.java

...
    ioThreads = Math.max(Runtime.getRuntime().availableProcessors(), 2);
    workerThreads = ioThreads * 8;
...

在最新版本Springboot/Undertow中,要覆盖的属性如下:

示例:

server.undertow.threads.io=50
server.undertow.threads.worker=50