mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-03 03:41:53 +08:00
RocksDB increasing background threads to speedup compaction.
This commit is contained in:
parent
e7a82b68f2
commit
83e0368eaa
@ -339,7 +339,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi
|
|||||||
init( REPLACE_CONTENTS_BYTES, 1e5 );
|
init( REPLACE_CONTENTS_BYTES, 1e5 );
|
||||||
|
|
||||||
// KeyValueStoreRocksDB
|
// KeyValueStoreRocksDB
|
||||||
init( ROCKSDB_BACKGROUND_PARALLELISM, 0 );
|
init( ROCKSDB_BACKGROUND_PARALLELISM, 4 );
|
||||||
init( ROCKSDB_READ_PARALLELISM, 4 );
|
init( ROCKSDB_READ_PARALLELISM, 4 );
|
||||||
// Use a smaller memtable in simulation to avoid OOMs.
|
// Use a smaller memtable in simulation to avoid OOMs.
|
||||||
int64_t memtableBytes = isSimulated ? 32 * 1024 : 512 * 1024 * 1024;
|
int64_t memtableBytes = isSimulated ? 32 * 1024 : 512 * 1024 * 1024;
|
||||||
@ -366,6 +366,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi
|
|||||||
init( ROCKSDB_WRITE_RATE_LIMITER_AUTO_TUNE, true );
|
init( ROCKSDB_WRITE_RATE_LIMITER_AUTO_TUNE, true );
|
||||||
init( ROCKSDB_PERFCONTEXT_ENABLE, false ); if( randomize && BUGGIFY ) ROCKSDB_PERFCONTEXT_ENABLE = deterministicRandom()->coinflip() ? false : true;
|
init( ROCKSDB_PERFCONTEXT_ENABLE, false ); if( randomize && BUGGIFY ) ROCKSDB_PERFCONTEXT_ENABLE = deterministicRandom()->coinflip() ? false : true;
|
||||||
init( ROCKSDB_PERFCONTEXT_SAMPLE_RATE, 0.0001 );
|
init( ROCKSDB_PERFCONTEXT_SAMPLE_RATE, 0.0001 );
|
||||||
|
init( ROCKSDB_MAX_SUBCOMPACTIONS, 2 );
|
||||||
|
|
||||||
// Leader election
|
// Leader election
|
||||||
bool longLeaderElection = randomize && BUGGIFY;
|
bool longLeaderElection = randomize && BUGGIFY;
|
||||||
|
@ -297,6 +297,7 @@ public:
|
|||||||
bool ROCKSDB_WRITE_RATE_LIMITER_AUTO_TUNE;
|
bool ROCKSDB_WRITE_RATE_LIMITER_AUTO_TUNE;
|
||||||
bool ROCKSDB_PERFCONTEXT_ENABLE; // Enable rocks perf context metrics. May cause performance overhead
|
bool ROCKSDB_PERFCONTEXT_ENABLE; // Enable rocks perf context metrics. May cause performance overhead
|
||||||
double ROCKSDB_PERFCONTEXT_SAMPLE_RATE;
|
double ROCKSDB_PERFCONTEXT_SAMPLE_RATE;
|
||||||
|
int ROCKSDB_MAX_SUBCOMPACTIONS;
|
||||||
|
|
||||||
// Leader election
|
// Leader election
|
||||||
int MAX_NOTIFICATIONS;
|
int MAX_NOTIFICATIONS;
|
||||||
|
@ -194,6 +194,9 @@ rocksdb::Options getOptions() {
|
|||||||
if (SERVER_KNOBS->ROCKSDB_BACKGROUND_PARALLELISM > 0) {
|
if (SERVER_KNOBS->ROCKSDB_BACKGROUND_PARALLELISM > 0) {
|
||||||
options.IncreaseParallelism(SERVER_KNOBS->ROCKSDB_BACKGROUND_PARALLELISM);
|
options.IncreaseParallelism(SERVER_KNOBS->ROCKSDB_BACKGROUND_PARALLELISM);
|
||||||
}
|
}
|
||||||
|
if (SERVER_KNOBS->ROCKSDB_MAX_SUBCOMPACTIONS > 0) {
|
||||||
|
options.max_subcompactions = SERVER_KNOBS->ROCKSDB_MAX_SUBCOMPACTIONS;
|
||||||
|
}
|
||||||
|
|
||||||
options.statistics = rocksdb::CreateDBStatistics();
|
options.statistics = rocksdb::CreateDBStatistics();
|
||||||
options.statistics->set_stats_level(rocksdb::kExceptHistogramOrTimers);
|
options.statistics->set_stats_level(rocksdb::kExceptHistogramOrTimers);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user