diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index a0b8b004ae..d84f051eca 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -2776,10 +2776,10 @@ impl AccountsDb { pub fn shrink_all_slots(&self, is_startup: bool, last_full_snapshot_slot: Option) { const DIRTY_STORES_CLEANING_THRESHOLD: usize = 10_000; const OUTER_CHUNK_SIZE: usize = 2000; - const INNER_CHUNK_SIZE: usize = OUTER_CHUNK_SIZE / 8; if is_startup && self.caching_enabled { let slots = self.all_slots_in_storage(); - let inner_chunk_size = std::cmp::max(INNER_CHUNK_SIZE, 1); + let threads = num_cpus::get(); + let inner_chunk_size = std::cmp::max(OUTER_CHUNK_SIZE / threads, 1); slots.chunks(OUTER_CHUNK_SIZE).for_each(|chunk| { chunk.par_chunks(inner_chunk_size).for_each(|slots| { for slot in slots {