Quarkus performance tuning

Does anyone have Quarkus performance tuning recommendations for Keycloak. I’ve been running the keycloak-benchmark AuthorizationCode scenario on a well-provisioned cluster, and it frequently falls over with the below error even with the Keycloak cluster CPU load average below 20% and the database below 15%.

Curious if anyone here has had success with Quarkus performance tuning, as it seems like it’s just vertx resource exhaustion. E.g.

quarkus.vertx.event-loops-pool-size=16
# Core blocking threads: 2 per core
quarkus.thread-pool.core-threads=16
# Max blocking threads: 5–8 per core, if needed
quarkus.thread-pool.max-threads=64
# Queue size for blocking tasks: prevent unbounded growth under load
quarkus.thread-pool.queue-size=4096

For reference, this is the error I’m getting:

2025-04-25 19:11:27,380 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-422) Uncaught server error: java.io.IOException: java.nio.channels.ClosedChannelException
        at org.jboss.resteasy.reactive.server.vertx.VertxInputStream$VertxBlockingInput.readBlocking(VertxInputStream.java:256)
        at org.jboss.resteasy.reactive.server.vertx.VertxInputStream.readIntoBuffer(VertxInputStream.java:123)
        at org.jboss.resteasy.reactive.server.vertx.VertxInputStream.read(VertxInputStream.java:85)
        at org.jboss.resteasy.reactive.server.vertx.VertxInputStream.read(VertxInputStream.java:73)
        at org.jboss.resteasy.reactive.server.vertx.VertxInputStream.read(VertxInputStream.java:64)
        at org.jboss.resteasy.reactive.server.handlers.FormBodyHandler$CapturingInputStream.read(FormBodyHandler.java:132)
        at java.base/java.io.InputStream.read(InputStream.java:287)
        at java.base/java.io.InputStream.read(InputStream.java:220)
        at org.jboss.resteasy.reactive.server.core.multipart.FormEncodedDataDefinition$FormEncodedDataParser.parseBlocking(FormEncodedDataDefinition.java:235)
        at org.jboss.resteasy.reactive.server.handlers.FormBodyHandler.handle(FormBodyHandler.java:95)
        at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:150)
        at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
        at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:635)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1505)
        at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
        at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.nio.channels.ClosedChannelException
        at org.jboss.resteasy.reactive.server.vertx.VertxInputStream$VertxBlockingInput.<init>(VertxInputStream.java:184)
        at org.jboss.resteasy.reactive.server.vertx.VertxInputStream.<init>(VertxInputStream.java:39)
        at org.jboss.resteasy.reactive.server.vertx.VertxResteasyReactiveRequestContext.createInputStream(VertxResteasyReactiveRequestContext.java:249)
        at org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext.getInputStream(ResteasyReactiveRequestContext.java:719)
        at org.jboss.resteasy.reactive.server.handlers.FormBodyHandler.handle(FormBodyHandler.java:92)
        ... 10 more