Skip to content

Commit

Permalink
Make more RocksDB tunables
Browse files Browse the repository at this point in the history
Add support for universal compaction
  • Loading branch information
JoelKatz authored and nbougalis committed Sep 5, 2014
1 parent 6b09e49 commit c72dff5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/ripple/nodestore/backend/RocksDBFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,22 @@ class RocksDBBackend
}
}

if (! keyValues["block_size"].isEmpty ())
{
options.block_size = keyValues["block_size"].getIntValue ();
}

if (! keyValues["universal_compaction"].isEmpty ())
{
if (keyValues["universal_compaction"].getIntValue () != 0)
{
options.compaction_style = rocksdb:: kCompactionStyleUniversal;
options.min_write_buffer_number_to_merge = 2;
options.max_write_buffer_number = 6;
options.write_buffer_size = 6 * options.target_file_size_base;
}
}

rocksdb::DB* db = nullptr;
rocksdb::Status status = rocksdb::DB::Open (options, m_name, &db);
if (!status.ok () || !db)
Expand Down

0 comments on commit c72dff5

Please sign in to comment.