When running Spring Boot web application with spring.threads.virtual.enabled=true
the JettyVirtualThreadsWebServerFactoryCustomizer
creates and configures QueuedThreadPool
and sets it on factory. Please note following default values:
server.jetty.threads.min=8
server.jetty.threads.max=200
server.jetty.threads.idle-timeout=60000ms
This results in virtual threads being reused which I believe is not advised. Also documentation indicates org.eclipse.jetty.util.thread.VirtualThreadPool
as preferred way to configure virtual threads support.