Skip to content

Commit

Permalink
feat(defaults): change cpu and batching defaults
Browse files Browse the repository at this point in the history
default_min_batch_count=5
default_max_batch_count=30
default_max_proof_batch_size=128

default_system_cpu_count=1
default_cpus_range=1-total # we always leave 1 core to OS
  • Loading branch information
justprosh committed Sep 17, 2024
1 parent 0215f90 commit 8bd138c
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions crates/server-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,14 @@ pub fn default_bootstrap_nodes() -> Vec<Multiaddr> {
}

pub fn default_system_cpu_count() -> usize {
let total = num_cpus::get_physical();
match total {
x if x > 32 => 3,
x if x > 7 => 2,
_ => 1,
}
1
}

pub fn default_cpus_range() -> Option<CoreRange> {
let total = num_cpus::get_physical();
let left = match total {
// Leave 1 core to OS if there's 8+ cores
c if c >= 8 => 1,
_ => 0,
};

// Leave 1 core to OS
let left = 1;
Some(
CoreRange::try_from(Vec::from_iter(left..total).as_slice())
.expect("Cpu range can't be empty"),
Expand Down Expand Up @@ -281,15 +274,15 @@ pub fn default_proof_poll_period() -> Duration {
}

pub fn default_min_batch_count() -> usize {
1
5
}

pub fn default_max_batch_count() -> usize {
4
30
}

pub fn default_max_proof_batch_size() -> usize {
2
128
}

pub fn default_epoch_end_window() -> Duration {
Expand Down

0 comments on commit 8bd138c

Please sign in to comment.