diff --git a/component/init/configs/service.toml b/component/init/configs/service.toml index f59b089d2b..941fd10d7a 100644 --- a/component/init/configs/service.toml +++ b/component/init/configs/service.toml @@ -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" diff --git a/lib/si-layer-cache/src/hybrid_cache.rs b/lib/si-layer-cache/src/hybrid_cache.rs index 4d00fb77e9..2c9a5f6fe8 100644 --- a/lib/si-layer-cache/src/hybrid_cache.rs +++ b/lib/si-layer-cache/src/hybrid_cache.rs @@ -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 = LazyLock::new(|| { let sys = sysinfo::System::new_all(); @@ -126,6 +127,7 @@ where .with_buffer_pool_size(config.disk_buffer_size) .with_eviction_pickers(vec![Box::::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), ) @@ -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 { @@ -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, } } }