From 7006a6f94f58fdfa9169121ab19e010d9b263d9f Mon Sep 17 00:00:00 2001 From: Lijun Wang <83639177+lijunwangs@users.noreply.github.com> Date: Tue, 10 Oct 2023 16:34:03 -0700 Subject: [PATCH] Reduce ConnectionPool size used by send-transaction-service (#33548) 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. --- connection-cache/src/connection_cache.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/connection-cache/src/connection_cache.rs b/connection-cache/src/connection_cache.rs index 4962f815c..a674dccd7 100644 --- a/connection-cache/src/connection_cache.rs +++ b/connection-cache/src/connection_cache.rs @@ -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 { @@ -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)));