Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["examples", "jito_protos", "proxy"]
resolver = "2"

[workspace.package]
version = "0.2.13"
version = "0.2.14"
description = "Fast path to receive shreds from Jito, forwarding to local consumers. See https://docs.jito.wtf/lowlatencytxnfeed/ for details."
authors = ["Jito Team <team@jito.wtf>"]
homepage = "https://jito.wtf/"
Expand Down
3 changes: 2 additions & 1 deletion proxy/src/forwarder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pub fn start_forwarder_threads(
src_port: u16,
maybe_multicast_socket: Option<Vec<UdpSocket>>,
num_threads: Option<usize>,
coalesce: Duration,
deduper: Arc<RwLock<Deduper<2, [u8]>>>,
should_reconstruct_shreds: bool,
entry_sender: Arc<Sender<PbEntry>>,
Expand Down Expand Up @@ -148,7 +149,7 @@ pub fn start_forwarder_threads(
packet_sender,
recycler.clone(),
forward_stats.clone(),
Duration::default(),
coalesce,
false,
None,
false,
Expand Down
8 changes: 8 additions & 0 deletions proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ struct CommonArgs {
#[arg(long, env)]
num_threads: Option<usize>,

/// Time in milliseconds to coalesce incoming packets into a batch before forwarding.
/// `0` (default) forwards each batch as soon as it is received for lowest latency.
/// A higher value waits up to this long to build larger batches, reducing CPU usage
/// at the cost of added latency.
#[arg(long, env, default_value_t = 0)]
coalesce_ms: u64,

/// Address to bind prometheus metrics server to. If not provided, prometheus server is disabled.
#[arg(long, env)]
prometheus_bind_addr: Option<SocketAddr>,
Expand Down Expand Up @@ -356,6 +363,7 @@ fn main() -> Result<(), ShredstreamProxyError> {
args.src_bind_port,
maybe_multicast_socket,
args.num_threads,
Duration::from_millis(args.coalesce_ms),
deduper.clone(),
args.grpc_service_port.is_some(),
entry_sender.clone(),
Expand Down
Loading