Bloom stats, fix thread caps
This commit is contained in:
parent
5c6e6411f5
commit
f9fb679f9b
@ -61,7 +61,6 @@ import org.rocksdb.FlushOptions;
|
|||||||
import org.rocksdb.IndexType;
|
import org.rocksdb.IndexType;
|
||||||
import org.rocksdb.InfoLogLevel;
|
import org.rocksdb.InfoLogLevel;
|
||||||
import org.rocksdb.OptimisticTransactionDB;
|
import org.rocksdb.OptimisticTransactionDB;
|
||||||
import org.rocksdb.Options;
|
|
||||||
import org.rocksdb.RocksDB;
|
import org.rocksdb.RocksDB;
|
||||||
import org.rocksdb.RocksDBException;
|
import org.rocksdb.RocksDBException;
|
||||||
import org.rocksdb.Snapshot;
|
import org.rocksdb.Snapshot;
|
||||||
@ -287,17 +286,33 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
|
|||||||
this.dbRScheduler = Schedulers.boundedElastic();
|
this.dbRScheduler = Schedulers.boundedElastic();
|
||||||
} else {
|
} else {
|
||||||
// 8 or more
|
// 8 or more
|
||||||
threadCap = Math.max(8, Math.max(Runtime.getRuntime().availableProcessors(),
|
threadCap = Math.max(8, Runtime.getRuntime().availableProcessors());
|
||||||
Integer.parseInt(System.getProperty("it.cavallium.dbengine.scheduler.threads", "0"))));
|
{
|
||||||
if (Boolean.parseBoolean(System.getProperty("it.cavallium.dbengine.scheduler.shared", "true"))) {
|
var threadCapProperty = Integer.parseInt(System.getProperty("it.cavallium.dbengine.scheduler.write.threads", "0"));
|
||||||
|
if (threadCapProperty > 1) {
|
||||||
|
threadCap = threadCapProperty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Boolean.parseBoolean(System.getProperty("it.cavallium.dbengine.scheduler.write.shared", "true"))) {
|
||||||
this.dbWScheduler = Schedulers.boundedElastic();
|
this.dbWScheduler = Schedulers.boundedElastic();
|
||||||
this.dbRScheduler = Schedulers.boundedElastic();
|
|
||||||
} else {
|
} else {
|
||||||
this.dbWScheduler = Schedulers.newBoundedElastic(threadCap,
|
this.dbWScheduler = Schedulers.newBoundedElastic(threadCap,
|
||||||
Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE,
|
Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE,
|
||||||
new ShortNamedThreadFactory("db-write-" + name).setDaemon(true).withGroup(new ThreadGroup("database-write")),
|
new ShortNamedThreadFactory("db-write-" + name).setDaemon(true).withGroup(new ThreadGroup("database-write")),
|
||||||
60
|
60
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
// 8 or more
|
||||||
|
threadCap = Math.max(8, Runtime.getRuntime().availableProcessors());
|
||||||
|
{
|
||||||
|
var threadCapProperty = Integer.parseInt(System.getProperty("it.cavallium.dbengine.scheduler.read.threads", "0"));
|
||||||
|
if (threadCapProperty > 1) {
|
||||||
|
threadCap = threadCapProperty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Boolean.parseBoolean(System.getProperty("it.cavallium.dbengine.scheduler.read.shared", "true"))) {
|
||||||
|
this.dbRScheduler = Schedulers.boundedElastic();
|
||||||
|
} else {
|
||||||
this.dbRScheduler = Schedulers.newBoundedElastic(threadCap,
|
this.dbRScheduler = Schedulers.newBoundedElastic(threadCap,
|
||||||
Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE,
|
Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE,
|
||||||
new ShortNamedThreadFactory("db-write-" + name).setDaemon(true).withGroup(new ThreadGroup("database-read")),
|
new ShortNamedThreadFactory("db-write-" + name).setDaemon(true).withGroup(new ThreadGroup("database-read")),
|
||||||
@ -368,6 +383,13 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
|
|||||||
registerGauge(meterRegistry, name, "rocksdb.estimate-num-keys");
|
registerGauge(meterRegistry, name, "rocksdb.estimate-num-keys");
|
||||||
registerGauge(meterRegistry, name, "rocksdb.block-cache-usage");
|
registerGauge(meterRegistry, name, "rocksdb.block-cache-usage");
|
||||||
registerGauge(meterRegistry, name, "rocksdb.block-cache-pinned-usage");
|
registerGauge(meterRegistry, name, "rocksdb.block-cache-pinned-usage");
|
||||||
|
// Bloom seek stats
|
||||||
|
registerGauge(meterRegistry, name, "rocksdb.bloom.filter.prefix.useful");
|
||||||
|
registerGauge(meterRegistry, name, "rocksdb.bloom.filter.prefix.checked");
|
||||||
|
// Bloom point lookup stats
|
||||||
|
registerGauge(meterRegistry, name, "rocksdb.bloom.filter.useful");
|
||||||
|
registerGauge(meterRegistry, name, "rocksdb.bloom.filter.full.positive");
|
||||||
|
registerGauge(meterRegistry, name, "rocksdb.bloom.filter.full.true.positive");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Column, ColumnFamilyHandle> getAllColumnFamilyHandles() {
|
public Map<Column, ColumnFamilyHandle> getAllColumnFamilyHandles() {
|
||||||
@ -615,9 +637,10 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
|
|||||||
return List.of(new DbPath(databasesDirPath.resolve(path.getFileName() + "_hot"),
|
return List.of(new DbPath(databasesDirPath.resolve(path.getFileName() + "_hot"),
|
||||||
100L * 1024L * 1024L * 1024L), // 100GiB
|
100L * 1024L * 1024L * 1024L), // 100GiB
|
||||||
new DbPath(databasesDirPath.resolve(path.getFileName() + "_cold"),
|
new DbPath(databasesDirPath.resolve(path.getFileName() + "_cold"),
|
||||||
500L * 1024L * 1024L * 1024L), // 500GiB
|
0), // Legacy
|
||||||
new DbPath(databasesDirPath.resolve(path.getFileName() + "_colder"),
|
new DbPath(databasesDirPath.resolve(path.getFileName() + "_colder"),
|
||||||
500L * 1024L * 1024L * 1024L)); // 500GiB
|
0)
|
||||||
|
); // Legacy
|
||||||
}
|
}
|
||||||
for (DatabaseVolume volume : volumes) {
|
for (DatabaseVolume volume : volumes) {
|
||||||
Path volumePath;
|
Path volumePath;
|
||||||
|
Loading…
Reference in New Issue
Block a user