Skip to content

Commit

Permalink
feat(rocksdb): Select the option of Direct-IO in Rocksdb (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Smityz authored and Wu Tao committed Jan 10, 2020
1 parent bbae381 commit 0268530
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/server/pegasus_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,28 @@ pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r)
_db_opts.pegasus_data = true;

// read rocksdb::Options configurations

_db_opts.use_direct_reads = dsn_config_get_value_bool(
"pegasus.server", "rocksdb_use_direct_reads", false, "rocksdb options.use_direct_reads");

_db_opts.use_direct_io_for_flush_and_compaction =
dsn_config_get_value_bool("pegasus.server",
"rocksdb_use_direct_io_for_flush_and_compaction",
false,
"rocksdb options.use_direct_io_for_flush_and_compaction");

_db_opts.compaction_readahead_size =
dsn_config_get_value_uint64("pegasus.server",
"rocksdb_compaction_readahead_size",
2 * 1024 * 1024,
"rocksdb options.compaction_readahead_size");

_db_opts.writable_file_max_buffer_size =
dsn_config_get_value_uint64("pegasus.server",
"rocksdb_writable_file_max_buffer_size",
1024 * 1024,
"rocksdb options.writable_file_max_buffer_size");

_db_opts.write_buffer_size =
(size_t)dsn_config_get_value_uint64("pegasus.server",
"rocksdb_write_buffer_size",
Expand Down

0 comments on commit 0268530

Please sign in to comment.