Skip to content

Commit

Permalink
Reduce ConnectionPool size used by send-transaction-service (#33548)
Browse files Browse the repository at this point in the history
Reduce pool size for ConnectionCache used by send-transaction-service to 2 from 4. No significant slow down of performance from bench-tps testing using rpc-client which is used by send-transaction-service. This will reduce active connections maintained both on the server and client. This will enable us to cache connections for more nodes.
  • Loading branch information
lijunwangs authored Oct 10, 2023
1 parent c929775 commit 7006a6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion connection-cache/src/connection_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use {
const MAX_CONNECTIONS: usize = 1024;

/// Default connection pool size per remote address
pub const DEFAULT_CONNECTION_POOL_SIZE: usize = 4;
pub const DEFAULT_CONNECTION_POOL_SIZE: usize = 2;

#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum Protocol {
Expand Down Expand Up @@ -81,6 +81,7 @@ where
connection_config: C,
connection_manager: M,
) -> Self {
info!("Creating ConnectionCache {name}, pool size: {connection_pool_size}");
let (sender, receiver) = crossbeam_channel::unbounded();

let map = Arc::new(RwLock::new(IndexMap::with_capacity(MAX_CONNECTIONS)));
Expand Down

0 comments on commit 7006a6f

Please sign in to comment.