Skip to content

Commit

Permalink
Update core count
Browse files Browse the repository at this point in the history
  • Loading branch information
howardwu committed Feb 11, 2024
1 parent 36f31a1 commit d419d9d
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions cli/src/commands/start.rs
Expand Up @@ -464,23 +464,12 @@ impl Start {
fn runtime() -> Runtime {
// Retrieve the number of cores.
let num_cores = num_cpus::get();
// Determine the number of main cores.
let main_cores = match num_cores {
// Insufficient
0..=3 => {
eprintln!("The number of cores is insufficient, at least 4 are needed.");
std::process::exit(1);
}
// Efficiency mode
4..=8 => 2,
// Standard mode
9..=16 => 8,
// Performance mode
_ => 16,
};

// Initialize the number of tokio worker threads, max tokio blocking threads, and rayon cores.
// Note: We intentionally set the number of tokio worker threads and number of rayon cores to be
// more than the number of physical cores, because the node is expected to be I/O-bound.
let (num_tokio_worker_threads, max_tokio_blocking_threads, num_rayon_cores_global) =
(num_cores, 512, main_cores);
(2 * num_cores, 512, num_cores);

// Initialize the parallelization parameters.
rayon::ThreadPoolBuilder::new()
Expand Down

0 comments on commit d419d9d

Please sign in to comment.