Reduce scylla conn count

This commit is contained in:
Dominik Werder
2025-05-15 14:11:26 +02:00
parent 7f6eabd847
commit 820a81130e
2 changed files with 9 additions and 2 deletions

View File

@@ -24,7 +24,6 @@ use netpod::TsMs;
use netpod::TsNano;
use netpod::channelstatus::ChannelStatus;
use netpod::channelstatus::ChannelStatusClosedReason;
use netpod::timeunits::*;
use netpod::ttl::RetentionTime;
use proto::CaDataValue;
use proto::CaEventValue;

View File

@@ -6,7 +6,10 @@ use scylla::client::PoolSize;
use scylla::client::execution_profile::ExecutionProfileBuilder;
use scylla::client::session_builder::GenericSessionBuilder;
use scylla::errors::NewSessionError;
use scylla::routing::ShardAwarePortRange;
use scylla::statement::Consistency;
use std::num::NonZero;
use std::ops::RangeInclusive;
use std::sync::Arc;
autoerr::create_error_v1!(
@@ -27,8 +30,13 @@ pub async fn create_session_no_ks(scyconf: &ScyllaIngestConfig) -> Result<Arc<Se
.consistency(Consistency::LocalOne)
.build()
.into_handle();
let port_range: RangeInclusive<u16> = 32000u16..=36000u16;
let _port_range = ShardAwarePortRange::new(port_range).unwrap();
let scy = GenericSessionBuilder::new()
.pool_size(PoolSize::default())
// .disallow_shard_aware_port(true)
// .shard_aware_local_port_range(port_range)
// .pool_size(PoolSize::default())
.pool_size(PoolSize::PerHost(NonZero::new(1).unwrap()))
.known_nodes(scyconf.hosts())
.default_execution_profile_handle(profile)
.write_coalescing(true)