diff --git a/fdbclient/ServerKnobs.cpp b/fdbclient/ServerKnobs.cpp index 917664343c..fa105eb5e1 100644 --- a/fdbclient/ServerKnobs.cpp +++ b/fdbclient/ServerKnobs.cpp @@ -384,6 +384,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( ROCKSDB_CAN_COMMIT_DELAY_ON_OVERLOAD, 1 ); init( ROCKSDB_CAN_COMMIT_DELAY_TIMES_ON_OVERLOAD, 5 ); init( ROCKSDB_COMPACTION_READAHEAD_SIZE, 32768 ); // 32 KB, performs bigger reads when doing compaction. + init( ROCKSDB_BLOCK_SIZE, 32768 ); // 32 KB, size of the block in rocksdb cache. // Leader election bool longLeaderElection = randomize && BUGGIFY; diff --git a/fdbclient/ServerKnobs.h b/fdbclient/ServerKnobs.h index 13859ac9d6..d92d2c26df 100644 --- a/fdbclient/ServerKnobs.h +++ b/fdbclient/ServerKnobs.h @@ -316,6 +316,7 @@ public: int ROCKSDB_CAN_COMMIT_DELAY_ON_OVERLOAD; int ROCKSDB_CAN_COMMIT_DELAY_TIMES_ON_OVERLOAD; int64_t ROCKSDB_COMPACTION_READAHEAD_SIZE; + int64_t ROCKSDB_BLOCK_SIZE; // Leader election int MAX_NOTIFICATIONS; diff --git a/fdbserver/KeyValueStoreRocksDB.actor.cpp b/fdbserver/KeyValueStoreRocksDB.actor.cpp index 38d5863eaa..17d94df11b 100644 --- a/fdbserver/KeyValueStoreRocksDB.actor.cpp +++ b/fdbserver/KeyValueStoreRocksDB.actor.cpp @@ -294,6 +294,9 @@ rocksdb::ColumnFamilyOptions getCFOptions() { } bbOpts.block_cache = rocksdb_block_cache; } + if (SERVER_KNOBS->ROCKSDB_BLOCK_SIZE > 0) { + bbOpts.block_size = SERVER_KNOBS->ROCKSDB_BLOCK_SIZE; + } options.table_factory.reset(rocksdb::NewBlockBasedTableFactory(bbOpts));