From 6d42c168262634a1973056dad2c520bb37f16dba Mon Sep 17 00:00:00 2001 From: NikVolf Date: Wed, 8 Apr 2020 18:53:04 +0300 Subject: [PATCH 1/3] 128 -> 1024 --- bin/node/testing/src/bench.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/node/testing/src/bench.rs b/bin/node/testing/src/bench.rs index 5dd0d012fbf46..f3a6c12067179 100644 --- a/bin/node/testing/src/bench.rs +++ b/bin/node/testing/src/bench.rs @@ -186,7 +186,7 @@ impl BenchDb { pruning: PruningMode::ArchiveAll, source: sc_client_db::DatabaseSettingsSrc::Path { path: dir.into(), - cache_size: 128, + cache_size: 1024, }, }; From 52493c3641b228e9223184b605ade15070e8e310 Mon Sep 17 00:00:00 2001 From: NikVolf Date: Wed, 8 Apr 2020 19:47:29 +0300 Subject: [PATCH 2/3] add trace and set = 512 --- bin/node/testing/src/bench.rs | 2 +- client/db/src/utils.rs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/node/testing/src/bench.rs b/bin/node/testing/src/bench.rs index f3a6c12067179..2ca6428bedc30 100644 --- a/bin/node/testing/src/bench.rs +++ b/bin/node/testing/src/bench.rs @@ -186,7 +186,7 @@ impl BenchDb { pruning: PruningMode::ArchiveAll, source: sc_client_db::DatabaseSettingsSrc::Path { path: dir.into(), - cache_size: 1024, + cache_size: 512, }, }; diff --git a/client/db/src/utils.rs b/client/db/src/utils.rs index e62c4f052bb26..16239a82c2e24 100644 --- a/client/db/src/utils.rs +++ b/client/db/src/utils.rs @@ -243,6 +243,15 @@ pub fn open_database( db_config.memory_budget = memory_budget; + log::trace!( + target: "db", + "Open database at {}, state column budget: {} MiB, others({}) column cache: {} MiB", + path, + state_col_budget, + NUM_COLUMNS, + other_col_budget, + ); + Arc::new(Database::open(&db_config, &path).map_err(db_err)?) }, #[cfg(not(any(feature = "kvdb-rocksdb", test)))] From 8c66472962081cf9c522b160742227edab588488 Mon Sep 17 00:00:00 2001 From: NikVolf Date: Thu, 9 Apr 2020 09:57:02 +0300 Subject: [PATCH 3/3] fix doc comment --- client/db/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/db/src/lib.rs b/client/db/src/lib.rs index e00d608a5feed..70f666aebf0e5 100644 --- a/client/db/src/lib.rs +++ b/client/db/src/lib.rs @@ -284,7 +284,7 @@ pub enum DatabaseSettingsSrc { Path { /// Path to the database. path: PathBuf, - /// Cache size in bytes. + /// Cache size in MiB. cache_size: usize, },