configurable state cache size

This commit is contained in:
Robert Habermeier
2016-10-07 00:28:42 +02:00
parent 0c7a28779d
commit 745a50dfdf
13 changed files with 71 additions and 29 deletions

View File

@@ -79,6 +79,7 @@ pruning = "auto"
cache_size_db = 64
cache_size_blocks = 8
cache_size_queue = 50
cache_size_state = 25
cache_size = 128 # Overrides above caches with total size
fast_and_loose = false
db_compaction = "ssd"

View File

@@ -48,6 +48,7 @@ pruning = "fast"
cache_size_db = 128
cache_size_blocks = 16
cache_size_queue = 100
cache_size_state = 25
db_compaction = "ssd"
fat_db = "off"

View File

@@ -211,6 +211,8 @@ usage! {
or |c: &Config| otry!(c.footprint).cache_size_blocks.clone(),
flag_cache_size_queue: u32 = 50u32,
or |c: &Config| otry!(c.footprint).cache_size_queue.clone(),
flag_cache_size_state: u32 = 25u32,
or |c: &Config| otry!(c.footprint).cache_size_state.clone(),
flag_cache_size: Option<u32> = None,
or |c: &Config| otry!(c.footprint).cache_size.clone().map(Some),
flag_fast_and_loose: bool = false,
@@ -361,6 +363,7 @@ struct Footprint {
cache_size_db: Option<u32>,
cache_size_blocks: Option<u32>,
cache_size_queue: Option<u32>,
cache_size_state: Option<u32>,
db_compaction: Option<String>,
fat_db: Option<String>,
}
@@ -532,6 +535,7 @@ mod tests {
flag_cache_size_db: 64u32,
flag_cache_size_blocks: 8u32,
flag_cache_size_queue: 50u32,
flag_cache_size_state: 25u32,
flag_cache_size: Some(128),
flag_fast_and_loose: false,
flag_db_compaction: "ssd".into(),
@@ -686,6 +690,7 @@ mod tests {
cache_size_db: Some(128),
cache_size_blocks: Some(16),
cache_size_queue: Some(100),
cache_size_state: Some(25),
db_compaction: Some("ssd".into()),
fat_db: Some("off".into()),
}),

View File

@@ -209,6 +209,8 @@ Footprint Options:
megabytes (default: {flag_cache_size_blocks}).
--cache-size-queue MB Specify the maximum size of memory to use for block
queue (default: {flag_cache_size_queue}).
--cache-size-state MB Specify the maximum size of memory to use for
the state cache (default: {flag_cache_size_state}).
--cache-size MB Set total amount of discretionary memory to use for
the entire system, overrides other cache and queue
options.a (default: {flag_cache_size:?})