diff --git a/src/server/config.ini b/src/server/config.ini index 4c7f5e5d88..14efe890a0 100644 --- a/src/server/config.ini +++ b/src/server/config.ini @@ -343,6 +343,8 @@ # format_version=5. This provides a smooth path for automatic adoption over time, with an # option for early opt-in. rocksdb_format_version = 2 + # default of periodic_compaction_seconds is disabled + rocksdb_periodic_compaction_seconds = 0 # 3000, 30MB, 1000, 30s rocksdb_multi_get_max_iteration_count = 3000 diff --git a/src/server/pegasus_server_impl_init.cpp b/src/server/pegasus_server_impl_init.cpp index c1bdc19a8c..cf34f04cb3 100644 --- a/src/server/pegasus_server_impl_init.cpp +++ b/src/server/pegasus_server_impl_init.cpp @@ -586,6 +586,12 @@ pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r) _key_ttl_compaction_filter_factory = std::make_shared(); _data_cf_opts.compaction_filter_factory = _key_ttl_compaction_filter_factory; + _data_cf_opts.periodic_compaction_seconds = + dsn_config_get_value_uint64("pegasus.server", + "rocksdb_periodic_compaction_seconds", + 0, + "periodic_compaction_seconds, 0 means no periodic compaction"); + // get the checkpoint reserve options. _checkpoint_reserve_min_count_in_config = (uint32_t)dsn_config_get_value_uint64( "pegasus.server", "checkpoint_reserve_min_count", 2, "checkpoint_reserve_min_count");