55 |
if (max_workers <= 0) { |
if (max_workers <= 0) { |
56 |
logger.info("!!! AUTO-DETECT MAX_WORKERS !!!"); |
logger.info("!!! AUTO-DETECT MAX_WORKERS !!!"); |
57 |
int cores = Runtime.getRuntime().availableProcessors(); |
int cores = Runtime.getRuntime().availableProcessors(); |
58 |
|
cores -= 1;//Efterlad 1 core/cpu i reserve til systemet |
59 |
|
|
60 |
max_workers = cores - 1; //Efterlad 1 core/cpu i reserve til systemet |
max_workers = Math.max(1, cores); //Dog skal der som minimum være 1 core til beregning |
61 |
|
|
62 |
} |
} |
63 |
logger.info("Starting with MAX_WORKERS:" + max_workers); |
logger.info("Starting with MAX_WORKERS:" + max_workers); |