Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config,cpu,proofs): change cpu and batching defaults #2377

Merged
merged 4 commits into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions crates/server-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,17 @@ 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,
}
// always use 1 core for Nox's and CCP's system threads
// we use a simple constant here to make the behaviour as predictable as possible
1
justprosh marked this conversation as resolved.
Show resolved Hide resolved
}

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,
};

// always leave 0th core to OS
// we use a simple constant here to make the behaviour as predictable as possible
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 +277,18 @@ pub fn default_proof_poll_period() -> Duration {
}

pub fn default_min_batch_count() -> usize {
1
// Wait for at least 5 proofs before sending the tx to reduce TPS
5
folex marked this conversation as resolved.
Show resolved Hide resolved
}

pub fn default_max_batch_count() -> usize {
4
// 30 is the default minimal proof count per CU on the mainnet
30
folex marked this conversation as resolved.
Show resolved Hide resolved
}

pub fn default_max_proof_batch_size() -> usize {
2
// 128 is the average CU number on a single machine
128
folex marked this conversation as resolved.
Show resolved Hide resolved
}

pub fn default_epoch_end_window() -> Duration {
Expand Down
Loading