diff --git a/fdbserver/KeyValueStoreRocksDB.actor.cpp b/fdbserver/KeyValueStoreRocksDB.actor.cpp index 0b05453c9c..1134499c2d 100644 --- a/fdbserver/KeyValueStoreRocksDB.actor.cpp +++ b/fdbserver/KeyValueStoreRocksDB.actor.cpp @@ -269,7 +269,6 @@ struct RocksDBKeyValueStore : IKeyValueStore { UID id; Reference writeThread; Reference readThreads; - unsigned nReaders = 16; Promise errorPromise; Promise closePromise; std::unique_ptr writeBatch; @@ -281,7 +280,7 @@ struct RocksDBKeyValueStore : IKeyValueStore { writeThread = createGenericThreadPool(); readThreads = createGenericThreadPool(); writeThread->addThread(new Writer(db, id)); - for (unsigned i = 0; i < nReaders; ++i) { + for (unsigned i = 0; i < SERVER_KNOBS->ROCKSDB_READ_PARALLELISM; ++i) { readThreads->addThread(new Reader(db)); } } diff --git a/fdbserver/Knobs.cpp b/fdbserver/Knobs.cpp index 7d7847383e..24ae9899a1 100644 --- a/fdbserver/Knobs.cpp +++ b/fdbserver/Knobs.cpp @@ -315,6 +315,7 @@ void ServerKnobs::initialize(bool randomize, ClientKnobs* clientKnobs, bool isSi // KeyValueStoreRocksDB init( ROCKSDB_BACKGROUND_PARALLELISM, 0 ); + init( ROCKSDB_READ_PARALLELISM, 4 ); init( ROCKSDB_MEMTABLE_BYTES, 512 * 1024 * 1024 ); init( ROCKSDB_UNSAFE_AUTO_FSYNC, false ); init( ROCKSDB_PERIODIC_COMPACTION_SECONDS, 0 ); diff --git a/fdbserver/Knobs.h b/fdbserver/Knobs.h index 83d8fbe8a5..2538f6a397 100644 --- a/fdbserver/Knobs.h +++ b/fdbserver/Knobs.h @@ -250,6 +250,7 @@ public: // KeyValueStoreRocksDB int ROCKSDB_BACKGROUND_PARALLELISM; + int ROCKSDB_READ_PARALLELISM; int64_t ROCKSDB_MEMTABLE_BYTES; bool ROCKSDB_UNSAFE_AUTO_FSYNC; int64_t ROCKSDB_PERIODIC_COMPACTION_SECONDS;