Re-enable dedicated schedulers

This commit is contained in:
Andrea Cavalli 2022-03-20 16:14:31 +01:00
parent e34e1e5852
commit b1d8e3e48e
2 changed files with 12 additions and 9 deletions

View File

@ -219,17 +219,20 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
int threadCap; int threadCap;
if (databaseOptions.lowMemory()) { if (databaseOptions.lowMemory()) {
threadCap = Runtime.getRuntime().availableProcessors(); threadCap = Math.max(1, Runtime.getRuntime().availableProcessors());
this.dbScheduler = Schedulers.boundedElastic();
} else { } else {
// 8 or more // 8 or more
threadCap = Math.max(8, Runtime.getRuntime().availableProcessors()); threadCap = Math.max(8, Runtime.getRuntime().availableProcessors());
this.dbScheduler = Schedulers.newBoundedElastic(threadCap,
Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE,
"db-" + name,
60,
true
);
} }
this.dbScheduler = Schedulers.boundedElastic(); /*Schedulers.newBoundedElastic(threadCap,
Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE,
"db-" + name,
60,
true
);*/
this.enableColumnsBug = "true".equals(databaseOptions.extraFlags().getOrDefault("enableColumnBug", "false")); this.enableColumnsBug = "true".equals(databaseOptions.extraFlags().getOrDefault("enableColumnBug", "false"));
createIfNotExists(descriptors, rocksdbOptions, inMemory, dbPath, dbPathString); createIfNotExists(descriptors, rocksdbOptions, inMemory, dbPath, dbPathString);

View File

@ -87,8 +87,8 @@ public class LLLocalLuceneIndex implements LLLuceneIndex {
*/ */
private static final ReentrantLock shutdownLock = new ReentrantLock(); private static final ReentrantLock shutdownLock = new ReentrantLock();
private static final Scheduler luceneHeavyTasksScheduler = uninterruptibleScheduler(Schedulers.single(Schedulers.boundedElastic())); private static final Scheduler luceneHeavyTasksScheduler = uninterruptibleScheduler(Schedulers.single(Schedulers.boundedElastic()));
//todo: remove after https://github.com/reactor/reactor-core/issues/2960 is fixed private static final Scheduler bulkScheduler = uninterruptibleScheduler(Schedulers.newBoundedElastic(
private static final Scheduler bulkScheduler = Schedulers.boundedElastic(); DEFAULT_BOUNDED_ELASTIC_SIZE, DEFAULT_BOUNDED_ELASTIC_QUEUESIZE, "bulkBoundedElastic", 60, true));
static { static {
LLUtils.initHooks(); LLUtils.initHooks();