Skip to content

Make default ThreadPoolTaskExecutor scalable and not "fixed" at 8 threads #22835

@sdoeringNew

Description

@sdoeringNew

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions