Skip to content

Commit

Permalink
Merge pull request #5127 from systeminit/configurable_recover_concurr…
Browse files Browse the repository at this point in the history
…ency

feat: make foyer disk recover concurrency configurable
  • Loading branch information
sprutton1 authored Dec 13, 2024
2 parents 6cf877a + 416a0e6 commit b2f5488
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions component/init/configs/service.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ url = "$SI_NATS_URL"
[layer_db_config.cache_config]
disk_path = "$SI_LAYER_CACHE_DISK_PATH"
disk_admission_rate_limit = $SI_LAYER_CACHE_DISK_ADMISSION_RATE_LIMIT
disk_recover_concurrency = $SI_LAYER_CACHE_DISK_RECOVER_CONURRENCY

[audit.pg]
user = "si"
Expand Down
4 changes: 4 additions & 0 deletions lib/si-layer-cache/src/hybrid_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const DEFAULT_DISK_BUFFER_SIZE: usize = 1024 * 1024 * 128; // 128mb
const DEFAULT_DISK_BUFFER_FLUSHERS: usize = 2;
const DEFAULT_DISK_INDEXER_SHARDS: usize = 64;
const DEFAULT_DISK_RECLAIMERS: usize = 2;
const DEFAULT_DISK_RECOVER_CONCURRENCY: usize = 8;

static TOTAL_SYSTEM_MEMORY_BYTES: LazyLock<u64> = LazyLock::new(|| {
let sys = sysinfo::System::new_all();
Expand Down Expand Up @@ -126,6 +127,7 @@ where
.with_buffer_pool_size(config.disk_buffer_size)
.with_eviction_pickers(vec![Box::<FifoPicker>::default()])
.with_flushers(config.disk_buffer_flushers)
.with_recover_concurrency(config.disk_recover_concurrency)
.with_indexer_shards(config.disk_indexer_shards)
.with_reclaimers(config.disk_reclaimers),
)
Expand Down Expand Up @@ -208,6 +210,7 @@ pub struct CacheConfig {
disk_indexer_shards: usize,
disk_path: PathBuf,
disk_reclaimers: usize,
disk_recover_concurrency: usize,
}

impl Default for CacheConfig {
Expand All @@ -229,6 +232,7 @@ impl Default for CacheConfig {
disk_indexer_shards: DEFAULT_DISK_INDEXER_SHARDS,
disk_path,
disk_reclaimers: DEFAULT_DISK_RECLAIMERS,
disk_recover_concurrency: DEFAULT_DISK_RECOVER_CONCURRENCY,
}
}
}
Expand Down

0 comments on commit b2f5488

Please sign in to comment.