diff --git a/runtime/src/accounts_index_storage.rs b/runtime/src/accounts_index_storage.rs index 9781d702df..74ab683b69 100644 --- a/runtime/src/accounts_index_storage.rs +++ b/runtime/src/accounts_index_storage.rs @@ -44,11 +44,11 @@ impl Drop for AccountsIndexStorage { impl AccountsIndexStorage { pub fn new(bins: usize, config: &Option) -> AccountsIndexStorage { - const DEFAULT_THREADS: usize = 1; // soon, this will be a cpu calculation + let num_threads = std::cmp::max(2, num_cpus::get() / 4); let threads = config .as_ref() .and_then(|config| config.flush_threads) - .unwrap_or(DEFAULT_THREADS); + .unwrap_or(num_threads); let storage = Arc::new(BucketMapHolder::new(bins, config, threads));