I am trying to optimize the undertow server and I wanted to try setting the I/O threads (WORKER_IO_THREADS and WORKER_TASK_CORE_THREADS) for my HttpListener. Could you please help me with the required steps?
Undertow server = Undertow.builder().addHttpListener(80, "")
.setHandler(new HttpHandler() {
public void handleRequest(final HttpServerExchange exchange)
throws Exception {
String string_exchange = exchange.getQueryString();
str = <some work on string_exchange>
exchange.getResponseSender().send(str);
}
}).build();
server.start();
I did read that the XNIO worker associated with the listener needs to be configured. However I am not clear on how to go about this.