Refine Executor Service config.
Require at least a concurrency of 4.
This commit is contained in:
@@ -43,8 +43,8 @@ class ExecutorConfiguration {
|
||||
public ThreadPoolExecutorFactoryBean threadPoolExecutorFactoryBean() {
|
||||
|
||||
int processors = Runtime.getRuntime().availableProcessors();
|
||||
int threadCount = Math.max(2, processors - 4);
|
||||
log.info(String.format("Setting up Executor Service with %d Threads", threadCount));
|
||||
int threadCount = Math.max(4, processors - 4);
|
||||
log.info(String.format("Setting up Executor Service with %d Threads, %d processors", threadCount, processors));
|
||||
|
||||
ThreadPoolExecutorFactoryBean scheduler = new ThreadPoolExecutorFactoryBean();
|
||||
scheduler.setCorePoolSize(threadCount);
|
||||
|
||||
Reference in New Issue
Block a user