As of Spring Boot 2.1 the default ThreadPoolTaskExecutor changed. Its core size is eight. The max pool size is virtually infinity. But the pool does not scale on high load. In fact the pool will never go beyond those eight threads. That's because the queue size for spawning new threads will never be reached. Those queue size is also virtually infinity with over 2 billion waiting tasks in the queue.

The default ThreadPoolTaskExecutor is "fixed" to eight threads.

I propose a change to that behavior. The queue size for the default ThreadPoolTaskExecutor should be something reasonable. Perhaps 16? So new threads could spawn on high load with many @Async usages.

Comment From: snicoll

Thanks for the suggestion but this is just the default value and the documentation already explains how to change this value. If you mean to change the default value to 16, then I am not keen to do that. If you have high load use cases, this is reasonable that you should tune these settings and the documentation tells you exactly how.

Comment From: sdoeringNew

Well. As you mentioned the documentation perhaps you should read it.

"The thread pool uses 8 core threads that can grow and shrink according to the load."

That is definitely not the case. At least fix the documentation.

Comment From: snicoll

That is definitely not the case. At least fix the documentation.

The first part of the sentence states "The thread pool uses 8 core threads". The second part states they can "grow and shrink according to the load". When there is no load, there are no threads allocated and they can grow up to 8. There is also an example right below that sentence that showcases how you can go beyond 8.

I am happy to review a PR if you find the current phrasing misleading.