I'm working on a Spring Boot web application and facing an issue with thread management. My goal is to execute platform threads for certain operations, but it seems like my application is only capable of running NIO threads.
Details: Spring Boot Version: 3.2.1 Tomcat Version: Embedded Tomcat 10.1.17 (default with Spring Boot) Java Version: Java 21
Context: Since the new Virtual Thread released, i want to compare the performance of an I/O bound web application by using this three different scenarios:
- Executing my service setting Tomcat to use virtual threads
- Executing my service setting Tomcat to use NIO threads
- Executing my service setting Tomcat to use BIO threads (as known as platform threads)
I can easily execute the service with 1) and 2) by simply setting my application.yaml (or .properties) file with the following line:
spring: threads: virtual: enabled: true What i am looking for now is to set my Tomcat to use platform thread as a default thread pool. I know that since java 8 BIO thread has been removed as a standard connector for Tomcat (https://tomcat.apache.org/migration-85.html#BIO_connector_removed) For that reason i am having trouble setting my springboot application to use platform threads. I am very interested in make that works since i expect to see a huge gap performance by using BIO threads compared with Virtual Threads.
Goal: To use platform threads (BIO model). Issue: Whenever I try to use platform threads, they seem to default back to NIO threads. Is this due to the Tomcat version being used, or am I missing some configuration?
Thanks for reading, please let me know if you need further information