Configurable state cache size and enforce exact state cache size (#2314)

* Allow configuring state cache size via cli

* Track used cache size

* Expose memory counter to informant

* Enforce max cache size constraint exactly

* Default to 64 MiB

Co-Authored-By: cmichi <mich@elmueller.net>

* Remove self as parameter
This commit is contained in:
Michael Müller
2019-04-23 19:47:11 +02:00
committed by Gavin Wood
parent 3f06fe32f3
commit c6d15e2cea
11 changed files with 131 additions and 12 deletions
+2
View File
@@ -457,6 +457,7 @@ impl<Factory: ServiceFactory> Components for FullComponents<Factory> {
{
let db_settings = client_db::DatabaseSettings {
cache_size: config.database_cache_size.map(|u| u as usize),
state_cache_size: config.state_cache_size,
path: config.database_path.as_str().into(),
pruning: config.pruning.clone(),
};
@@ -532,6 +533,7 @@ impl<Factory: ServiceFactory> Components for LightComponents<Factory> {
{
let db_settings = client_db::DatabaseSettings {
cache_size: None,
state_cache_size: config.state_cache_size,
path: config.database_path.as_str().into(),
pruning: config.pruning.clone(),
};