Skip to content

Commit

Permalink
Bound the blockstore_process threadpool to a max of 24 threads
Browse files Browse the repository at this point in the history
  • Loading branch information
steviez committed Mar 3, 2024
1 parent 3f9a7a5 commit d503667
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ struct ReplayEntry {
starting_index: usize,
}

// get_max_thread_count to match number of threads in the old code.
// see: https://github.com/solana-labs/solana/pull/24853
// Max number of threads to allocate for executing transactions
const MAX_THREAD_POOL_SIZE: usize = 24;

lazy_static! {
static ref PAR_THREAD_POOL: ThreadPool = rayon::ThreadPoolBuilder::new()
.num_threads(get_max_thread_count())
.num_threads(get_max_thread_count().min(MAX_THREAD_POOL_SIZE))
.thread_name(|i| format!("solBstoreProc{i:02}"))
.build()
.unwrap();
Expand Down

0 comments on commit d503667

Please sign in to comment.