In a Java web application, I have a question about the ideal number of threads to create when using the newFixedThreadPool()
The examples from Java Concurrency in Practice always recommended creating it with Runtime.getRuntime().availableProcessors() + 1
However, in my web application, doing this seems to lock up the system for extended amounts of time (about 20-30 seconds), since there are also HTTP requests coming in from users and database threads for reading/writing data to the database.
Does anyone have a recommendation on the ideal number of threads to utilize towards the thread pool for crunching numbers, while still leaving some cores available for other aspects of running a responsive and speedy web application? Seems the example from the book is ideal in stand-alone applications, but not for web applications.