Skip to content

Commit

Permalink
fix: adjust channels, add debug to release profile
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberb committed Apr 24, 2024
1 parent e9bd98c commit d130dae
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ deprecated-in-future = "warn"
strip = true
codegen-units = 1 # https://nnethercote.github.io/perf-book/build-configuration.html#codegen-units
lto = "fat" # https://nnethercote.github.io/perf-book/build-configuration.html#link-time-optimization
debug = true # So we can un `perf` on the Rust binary

[workspace.dependencies]
topos-core = { path = "./crates/topos-core", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion crates/topos-p2p/src/behaviour/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{constants, event::ComposedEvent, TOPOS_ECHO, TOPOS_GOSSIP, TOPOS_REA

use super::HealthStatus;

const MAX_BATCH_SIZE: usize = 1024 * 100;
const MAX_BATCH_SIZE: usize = 1024 * 20;

pub struct Behaviour {
batch_size: usize,
Expand Down
2 changes: 1 addition & 1 deletion crates/topos-tce-broadcast/src/task_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl TaskManager {
}

pub async fn run(mut self, shutdown_receiver: CancellationToken) {
let mut pending_certificate_interval = tokio::time::interval(Duration::from_micros(500));
let mut pending_certificate_interval = tokio::time::interval(Duration::from_millis(200));

loop {
tokio::select! {
Expand Down
6 changes: 3 additions & 3 deletions crates/topos-tce-proxy/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ use topos_core::{
use tracing::{debug, error, info, info_span, warn, Instrument, Span};
use tracing_opentelemetry::OpenTelemetrySpanExt;

const CERTIFICATE_OUTBOUND_CHANNEL_SIZE: usize = 100;
const CERTIFICATE_INBOUND_CHANNEL_SIZE: usize = 100;
const TCE_PROXY_COMMAND_CHANNEL_SIZE: usize = 100;
const CERTIFICATE_OUTBOUND_CHANNEL_SIZE: usize = 1024 * 10;
const CERTIFICATE_INBOUND_CHANNEL_SIZE: usize = 1024 * 10;
const TCE_PROXY_COMMAND_CHANNEL_SIZE: usize = 1024 * 10;

// Maximum backoff retry timeout in seconds (1 hour)
const TCE_SUBMIT_CERTIFICATE_BACKOFF_TIMEOUT: Duration = Duration::from_secs(3600);
Expand Down
4 changes: 2 additions & 2 deletions crates/topos-tce-proxy/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ impl TceProxyWorker {
/// Construct a new [`TceProxyWorker`] with a 128 items deep channel to send commands to and receive events from a TCE node on the given subnet.
/// The worker holds a [`crate::client::TceClient`]
pub async fn new(config: TceProxyConfig) -> Result<(Self, Option<(Certificate, u64)>), Error> {
let (command_sender, mut command_rcv) = mpsc::channel::<TceProxyCommand>(128);
let (evt_sender, evt_rcv) = mpsc::channel::<TceProxyEvent>(128);
let (command_sender, mut command_rcv) = mpsc::channel::<TceProxyCommand>(1024 * 20);
let (evt_sender, evt_rcv) = mpsc::channel::<TceProxyEvent>(1024 * 20);
let (tce_client_shutdown_channel, shutdown_receiver) =
mpsc::channel::<oneshot::Sender<()>>(1);

Expand Down
2 changes: 1 addition & 1 deletion crates/topos-tce-synchronizer/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Default for SynchronizerBuilder {
network_client: None,
store: None,
config: SynchronizationConfig::default(),
event_channel_size: 100,
event_channel_size: 1024 * 20,
shutdown: None,
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/topos-tce/src/app_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl AppContext {
validator_store: Arc<ValidatorStore>,
api_context: RuntimeContext,
) -> (Self, mpsc::Receiver<Events>) {
let (events, receiver) = mpsc::channel(100);
let (events, receiver) = mpsc::channel(1024 * 20);
(
Self {
is_validator,
Expand Down

0 comments on commit d130dae

Please sign in to comment.