Tomcat allows by default max 200 threads to process requests in a Spring Boot application. Lets say within the application, during the start of the process, I create a FixedThreadpool of size say 10.
Now when I am trying to use this thing with tomcat, what would be the max total number of threads that I will be running. Will it be 200 + 10 or 200 * 10?
My understanding is that it will be 200 + 10 as at the process level only java will create the threadpool and use that threadpool whereever required.
Also will it depend on how i initiate the threadpool? For example let's say I create a bean of threadpool executor and use that across the system.
@Bean("helperExecutorService")
public ExecutorService helperExecutorService(HelperThreadPoolConfig helperThreadPoolConfig) {
return Executors.newFixedThreadPool(helperThreadPoolConfig.getThreadPoolSize());
}
Or I can create threadpool in the code flow.
public void something() {
ExecutorService service = Executors.newFixedThreadPool(summariesToAutocompute.size());
... use this threadpool in the method
}```