From 667456229d205bb49db936855eccd024090e0cd0 Mon Sep 17 00:00:00 2001 From: Yingchun Lai <405403881@qq.com> Date: Fri, 10 May 2019 20:36:01 +0800 Subject: [PATCH 1/3] log: reduce some rocksdb statistics log --- src/server/pegasus_server_impl.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/pegasus_server_impl.cpp b/src/server/pegasus_server_impl.cpp index ae99d12312..32bd9a43a3 100644 --- a/src/server/pegasus_server_impl.cpp +++ b/src/server/pegasus_server_impl.cpp @@ -2221,34 +2221,34 @@ void pegasus_server_impl::update_replica_rocksdb_statistics() } } _pfc_rdb_sst_count->set(val); - ddebug_replica("_pfc_rdb_sst_count: {}", val); + dinfo_replica("_pfc_rdb_sst_count: {}", val); if (_db->GetProperty(rocksdb::DB::Properties::kTotalSstFilesSize, &str_val) && dsn::buf2uint64(str_val, val)) { static uint64_t bytes_per_mb = 1U << 20U; _pfc_rdb_sst_size->set(val / bytes_per_mb); - ddebug_replica("_pfc_rdb_sst_size: {} bytes", val); + dinfo_replica("_pfc_rdb_sst_size: {} bytes", val); } uint64_t block_cache_hit = _statistics->getTickerCount(rocksdb::BLOCK_CACHE_HIT); _pfc_rdb_block_cache_hit_count->set(block_cache_hit); - ddebug_replica("_pfc_rdb_block_cache_hit_count: {}", block_cache_hit); + dinfo_replica("_pfc_rdb_block_cache_hit_count: {}", block_cache_hit); uint64_t block_cache_miss = _statistics->getTickerCount(rocksdb::BLOCK_CACHE_MISS); uint64_t block_cache_total = block_cache_hit + block_cache_miss; _pfc_rdb_block_cache_total_count->set(block_cache_total); - ddebug_replica("_pfc_rdb_block_cache_total_count: {}", block_cache_total); + dinfo_replica("_pfc_rdb_block_cache_total_count: {}", block_cache_total); if (_db->GetProperty(rocksdb::DB::Properties::kEstimateTableReadersMem, &str_val) && dsn::buf2uint64(str_val, val)) { _pfc_rdb_index_and_filter_blocks_mem_usage->set(val); - ddebug_replica("_pfc_rdb_index_and_filter_blocks_mem_usage: {} bytes", val); + dinfo_replica("_pfc_rdb_index_and_filter_blocks_mem_usage: {} bytes", val); } if (_db->GetProperty(rocksdb::DB::Properties::kCurSizeAllMemTables, &str_val) && dsn::buf2uint64(str_val, val)) { _pfc_rdb_memtable_mem_usage->set(val); - ddebug_replica("_pfc_rdb_memtable_mem_usage: {} bytes", val); + dinfo_replica("_pfc_rdb_memtable_mem_usage: {} bytes", val); } } From 16d902c509d4c0cb511df25700a92f1eeec3337e Mon Sep 17 00:00:00 2001 From: Yingchun Lai <405403881@qq.com> Date: Wed, 15 May 2019 17:02:24 +0800 Subject: [PATCH 2/3] reduce more log --- src/server/pegasus_server_impl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/pegasus_server_impl.cpp b/src/server/pegasus_server_impl.cpp index 32bd9a43a3..84bf8b93a3 100644 --- a/src/server/pegasus_server_impl.cpp +++ b/src/server/pegasus_server_impl.cpp @@ -2257,9 +2257,9 @@ void pegasus_server_impl::update_server_rocksdb_statistics() if (_block_cache) { uint64_t val = _block_cache->GetUsage(); _pfc_rdb_block_cache_mem_usage->set(val); - ddebug_f("_pfc_rdb_block_cache_mem_usage: {} bytes", val); + dinfo_f("_pfc_rdb_block_cache_mem_usage: {} bytes", val); } else { - ddebug("_pfc_rdb_block_cache_mem_usage: 0 bytes because block cache is diabled"); + dinfo("_pfc_rdb_block_cache_mem_usage: 0 bytes because block cache is disabled"); } } @@ -2470,7 +2470,7 @@ std::string pegasus_server_impl::compression_type_to_str(rocksdb::CompressionTyp bool pegasus_server_impl::set_usage_scenario(const std::string &usage_scenario) { if (usage_scenario == _usage_scenario) - return false; + return true; std::unordered_map new_options; if (usage_scenario == ROCKSDB_ENV_USAGE_SCENARIO_NORMAL || usage_scenario == ROCKSDB_ENV_USAGE_SCENARIO_PREFER_WRITE) { From dd5749444d7e33773ede0d9426051ce5964b8d08 Mon Sep 17 00:00:00 2001 From: Yingchun Lai <405403881@qq.com> Date: Wed, 15 May 2019 17:45:55 +0800 Subject: [PATCH 3/3] revert set_usage_scenario --- src/server/pegasus_server_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/pegasus_server_impl.cpp b/src/server/pegasus_server_impl.cpp index 84bf8b93a3..f37156a5f5 100644 --- a/src/server/pegasus_server_impl.cpp +++ b/src/server/pegasus_server_impl.cpp @@ -2470,7 +2470,7 @@ std::string pegasus_server_impl::compression_type_to_str(rocksdb::CompressionTyp bool pegasus_server_impl::set_usage_scenario(const std::string &usage_scenario) { if (usage_scenario == _usage_scenario) - return true; + return false; std::unordered_map new_options; if (usage_scenario == ROCKSDB_ENV_USAGE_SCENARIO_NORMAL || usage_scenario == ROCKSDB_ENV_USAGE_SCENARIO_PREFER_WRITE) {