Limit Rayon threadpool threads (#5871)

This commit is contained in:
Sagar Dhawan
2019-09-12 11:39:39 -07:00
committed by GitHub
parent 385086359c
commit c1d788880d
16 changed files with 73 additions and 30 deletions

View File

@@ -12,6 +12,7 @@ use crate::streamer::{PacketReceiver, PacketSender};
use rayon::iter::{IndexedParallelIterator, IntoParallelRefMutIterator, ParallelIterator};
use rayon::ThreadPool;
use solana_metrics::{inc_new_counter_debug, inc_new_counter_error};
use solana_rayon_threadlimit::get_thread_count;
use solana_runtime::bank::Bank;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::timing::duration_as_ms;
@@ -205,7 +206,7 @@ impl WindowService {
trace!("{}: RECV_WINDOW started", id);
let mut now = Instant::now();
let thread_pool = rayon::ThreadPoolBuilder::new()
.num_threads(sys_info::cpu_num().unwrap_or(NUM_THREADS) as usize)
.num_threads(get_thread_count())
.build()
.unwrap();
loop {