From 0a016a16745ec2b8bcf507a083567430ec3c180a Mon Sep 17 00:00:00 2001 From: Aleks Lozovyuk Date: Thu, 10 Aug 2023 22:58:19 +0300 Subject: [PATCH 1/6] Update kvrocks.conf Small fix in comments with default options --- kvrocks.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kvrocks.conf b/kvrocks.conf index 6e703edcef2..b979903b7cf 100644 --- a/kvrocks.conf +++ b/kvrocks.conf @@ -547,7 +547,7 @@ rocksdb.row_cache_size 0 # files opened are always kept open. You can estimate number of files based # on target_file_size_base and target_file_size_multiplier for level-based # compaction. For universal-style compaction, you can usually set it to -1. -# Default: 4096 +# Default: 8096 rocksdb.max_open_files 8096 # Amount of data to build up in memory (backed by an unsorted log @@ -576,7 +576,7 @@ rocksdb.target_file_size_base 128 # The default and the minimum number is 2, so that when 1 write buffer # is being flushed to storage, new writes can continue to the other # write buffer. -# If max_write_buffer_number > 3, writing will be slowed down to +# If max_write_buffer_number < 3, writing will be slowed down to # options.delayed_write_rate if we are writing to the last write buffer # allowed. rocksdb.max_write_buffer_number 4 @@ -603,7 +603,7 @@ rocksdb.max_background_flushes -1 # This value represents the maximum number of threads that will # concurrently perform a compaction job by breaking it into multiple, # smaller ones that are run simultaneously. -# Default: 2 (i.e. no subcompactions) +# Default: 2 rocksdb.max_sub_compactions 2 # In order to limit the size of WALs, RocksDB uses DBOptions::max_total_wal_size @@ -647,12 +647,12 @@ rocksdb.wal_size_limit_mb 16384 # actual size of the unit read from disk may be smaller if # compression is enabled. # -# Default: 4KB +# Default: 16KB rocksdb.block_size 16384 # Indicating if we'd put index/filter blocks to the block cache # -# Default: no +# Default: yes rocksdb.cache_index_and_filter_blocks yes # Specify the compression to use. Only compress level greater From 2caf5065f3c4d24efc4c312a186b2ffbde38bf29 Mon Sep 17 00:00:00 2001 From: Aleks Lozovyuk Date: Fri, 11 Aug 2023 00:53:50 +0300 Subject: [PATCH 2/6] Update config.cc --- src/config/config.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config/config.cc b/src/config/config.cc index 39d8d352658..4d02188bd3f 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -40,7 +40,7 @@ #include "server/server.h" #include "status.h" -constexpr const char *kDefaultBindAddress = "127.0.0.1"; +constexpr const char *kDefaultBindAddress = "0.0.0.0"; constexpr const char *errBlobDbNotEnabled = "Must set rocksdb.enable_blob_files to yes first."; constexpr const char *errLevelCompactionDynamicLevelBytesNotSet = @@ -162,14 +162,14 @@ Config::Config() { /* rocksdb options */ {"rocksdb.compression", false, new EnumField(&rocks_db.compression, compression_types, rocksdb::CompressionType::kNoCompression)}, - {"rocksdb.block_size", true, new IntField(&rocks_db.block_size, 4096, 0, INT_MAX)}, - {"rocksdb.max_open_files", false, new IntField(&rocks_db.max_open_files, 4096, -1, INT_MAX)}, + {"rocksdb.block_size", true, new IntField(&rocks_db.block_size, 16384, 0, INT_MAX)}, + {"rocksdb.max_open_files", false, new IntField(&rocks_db.max_open_files, 8096, -1, INT_MAX)}, {"rocksdb.write_buffer_size", false, new IntField(&rocks_db.write_buffer_size, 64, 0, 4096)}, {"rocksdb.max_write_buffer_number", false, new IntField(&rocks_db.max_write_buffer_number, 4, 0, 256)}, {"rocksdb.target_file_size_base", false, new IntField(&rocks_db.target_file_size_base, 128, 1, 1024)}, {"rocksdb.max_background_compactions", false, new IntField(&rocks_db.max_background_compactions, 2, -1, 32)}, {"rocksdb.max_background_flushes", true, new IntField(&rocks_db.max_background_flushes, 2, -1, 32)}, - {"rocksdb.max_sub_compactions", false, new IntField(&rocks_db.max_sub_compactions, 1, 0, 16)}, + {"rocksdb.max_sub_compactions", false, new IntField(&rocks_db.max_sub_compactions, 2, 0, 16)}, {"rocksdb.delayed_write_rate", false, new Int64Field(&rocks_db.delayed_write_rate, 0, 0, INT64_MAX)}, {"rocksdb.wal_ttl_seconds", true, new IntField(&rocks_db.wal_ttl_seconds, 3 * 3600, 0, INT_MAX)}, {"rocksdb.wal_size_limit_mb", true, new IntField(&rocks_db.wal_size_limit_mb, 16384, 0, INT_MAX)}, From dea83a1ae81d7426214978b5d510ce350c81d450 Mon Sep 17 00:00:00 2001 From: Aleks Lozovyuk Date: Fri, 11 Aug 2023 09:41:45 +0300 Subject: [PATCH 3/6] Revert max_write_buffer default desc --- kvrocks.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kvrocks.conf b/kvrocks.conf index b979903b7cf..c4a66b43487 100644 --- a/kvrocks.conf +++ b/kvrocks.conf @@ -576,7 +576,7 @@ rocksdb.target_file_size_base 128 # The default and the minimum number is 2, so that when 1 write buffer # is being flushed to storage, new writes can continue to the other # write buffer. -# If max_write_buffer_number < 3, writing will be slowed down to +# If max_write_buffer_number > 3, writing will be slowed down to # options.delayed_write_rate if we are writing to the last write buffer # allowed. rocksdb.max_write_buffer_number 4 From 75aaa273a47945357c2919a79ee6074e4c1ffe9f Mon Sep 17 00:00:00 2001 From: Aleks Lozovyuk Date: Fri, 11 Aug 2023 10:47:08 +0300 Subject: [PATCH 4/6] Update config.cc --- src/config/config.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/config.cc b/src/config/config.cc index 4d02188bd3f..a31aae79f9a 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -169,7 +169,7 @@ Config::Config() { {"rocksdb.target_file_size_base", false, new IntField(&rocks_db.target_file_size_base, 128, 1, 1024)}, {"rocksdb.max_background_compactions", false, new IntField(&rocks_db.max_background_compactions, 2, -1, 32)}, {"rocksdb.max_background_flushes", true, new IntField(&rocks_db.max_background_flushes, 2, -1, 32)}, - {"rocksdb.max_sub_compactions", false, new IntField(&rocks_db.max_sub_compactions, 2, 0, 16)}, + {"rocksdb.max_sub_compactions", false, new IntField(&rocks_db.max_sub_compactions, 4, 0, 16)}, {"rocksdb.delayed_write_rate", false, new Int64Field(&rocks_db.delayed_write_rate, 0, 0, INT64_MAX)}, {"rocksdb.wal_ttl_seconds", true, new IntField(&rocks_db.wal_ttl_seconds, 3 * 3600, 0, INT_MAX)}, {"rocksdb.wal_size_limit_mb", true, new IntField(&rocks_db.wal_size_limit_mb, 16384, 0, INT_MAX)}, @@ -177,7 +177,7 @@ Config::Config() { {"rocksdb.disable_auto_compactions", false, new YesNoField(&rocks_db.disable_auto_compactions, false)}, {"rocksdb.enable_pipelined_write", true, new YesNoField(&rocks_db.enable_pipelined_write, false)}, {"rocksdb.stats_dump_period_sec", false, new IntField(&rocks_db.stats_dump_period_sec, 0, 0, INT_MAX)}, - {"rocksdb.cache_index_and_filter_blocks", true, new YesNoField(&rocks_db.cache_index_and_filter_blocks, false)}, + {"rocksdb.cache_index_and_filter_blocks", false, new YesNoField(&rocks_db.cache_index_and_filter_blocks, true)}, {"rocksdb.block_cache_size", true, new IntField(&rocks_db.block_cache_size, 0, 0, INT_MAX)}, {"rocksdb.subkey_block_cache_size", true, new IntField(&rocks_db.subkey_block_cache_size, 2048, 0, INT_MAX)}, {"rocksdb.metadata_block_cache_size", true, new IntField(&rocks_db.metadata_block_cache_size, 2048, 0, INT_MAX)}, From e7c3ae174d7d359cb47f004ba3cc016e3de88c23 Mon Sep 17 00:00:00 2001 From: Aleks Lozovyuk Date: Fri, 11 Aug 2023 15:11:04 +0300 Subject: [PATCH 5/6] Update config.cc --- src/config/config.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/config.cc b/src/config/config.cc index a31aae79f9a..6dec54d67a6 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -177,7 +177,7 @@ Config::Config() { {"rocksdb.disable_auto_compactions", false, new YesNoField(&rocks_db.disable_auto_compactions, false)}, {"rocksdb.enable_pipelined_write", true, new YesNoField(&rocks_db.enable_pipelined_write, false)}, {"rocksdb.stats_dump_period_sec", false, new IntField(&rocks_db.stats_dump_period_sec, 0, 0, INT_MAX)}, - {"rocksdb.cache_index_and_filter_blocks", false, new YesNoField(&rocks_db.cache_index_and_filter_blocks, true)}, + {"rocksdb.cache_index_and_filter_blocks", true, new YesNoField(&rocks_db.cache_index_and_filter_blocks, true)}, {"rocksdb.block_cache_size", true, new IntField(&rocks_db.block_cache_size, 0, 0, INT_MAX)}, {"rocksdb.subkey_block_cache_size", true, new IntField(&rocks_db.subkey_block_cache_size, 2048, 0, INT_MAX)}, {"rocksdb.metadata_block_cache_size", true, new IntField(&rocks_db.metadata_block_cache_size, 2048, 0, INT_MAX)}, From 8bc6cc02aa9726dc9d24ffd0445da051e61d93df Mon Sep 17 00:00:00 2001 From: Aleks Lozovyuk Date: Fri, 11 Aug 2023 16:02:50 +0300 Subject: [PATCH 6/6] Update config.cc --- src/config/config.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/config.cc b/src/config/config.cc index 6dec54d67a6..5c9863c4946 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -169,7 +169,7 @@ Config::Config() { {"rocksdb.target_file_size_base", false, new IntField(&rocks_db.target_file_size_base, 128, 1, 1024)}, {"rocksdb.max_background_compactions", false, new IntField(&rocks_db.max_background_compactions, 2, -1, 32)}, {"rocksdb.max_background_flushes", true, new IntField(&rocks_db.max_background_flushes, 2, -1, 32)}, - {"rocksdb.max_sub_compactions", false, new IntField(&rocks_db.max_sub_compactions, 4, 0, 16)}, + {"rocksdb.max_sub_compactions", false, new IntField(&rocks_db.max_sub_compactions, 2, 0, 16)}, {"rocksdb.delayed_write_rate", false, new Int64Field(&rocks_db.delayed_write_rate, 0, 0, INT64_MAX)}, {"rocksdb.wal_ttl_seconds", true, new IntField(&rocks_db.wal_ttl_seconds, 3 * 3600, 0, INT_MAX)}, {"rocksdb.wal_size_limit_mb", true, new IntField(&rocks_db.wal_size_limit_mb, 16384, 0, INT_MAX)},