Skip to main content

PoolTuningConfig

Type Alias PoolTuningConfig 

Source
pub type PoolTuningConfig = PoolPressureMonitorConfig;
👎Deprecated since 2.0.1:

Use PoolPressureMonitorConfig

Expand description

Deprecated alias for PoolPressureMonitorConfig.

This type was renamed in v2.0.1 to clarify that pool monitoring operates in recommendation mode only — the pool is not resized at runtime. Use PoolPressureMonitorConfig in new code.

Aliased Type§

pub struct PoolTuningConfig {
    pub enabled: bool,
    pub min_pool_size: u32,
    pub max_pool_size: u32,
    pub target_queue_depth: u32,
    pub scale_up_step: u32,
    pub scale_down_step: u32,
    pub scale_down_idle_ratio: f64,
    pub tuning_interval_ms: u64,
    pub samples_before_action: u32,
}

Fields§

§enabled: bool

Enable adaptive pool sizing. Default: false.

§min_pool_size: u32

Minimum pool size. The tuner never shrinks below this value. Default: 5.

§max_pool_size: u32

Maximum pool size. The tuner never grows above this value. Default: 50.

§target_queue_depth: u32

Maximum acceptable queue depth before scaling up. Default: 3.

§scale_up_step: u32

Connections to add per scale-up step. Default: 5.

§scale_down_step: u32

Connections to remove per scale-down step. Default: 2.

§scale_down_idle_ratio: f64

Minimum idle ratio (idle / total) before considering a scale-down. Default: 0.5 (50% idle connections triggers potential shrink).

§tuning_interval_ms: u64

Polling interval in milliseconds. Default: 30 000 (30 s).

§samples_before_action: u32

Consecutive samples above threshold required before acting. Default: 3.