pub struct PoolConfig {
pub pool_size: u32,
pub min_connections: u32,
pub acquire_timeout: Duration,
pub idle_timeout: Duration,
pub max_lifetime: Duration,
pub max_message_len: usize,
}Expand description
Connection pool tuning.
These values can also be supplied in the connection URL (pool_size,
min_connections, acquire_timeout, idle_timeout, max_lifetime); a
PoolConfig passed to crate::Pool::connect overrides the URL.
Fields§
§pool_size: u32Maximum number of connections in the pool.
min_connections: u32Connections to open eagerly when the pool is created, and the floor the idle reaper will not drop below.
This is best-effort: if some connections cannot be established the pool starts with fewer, and the floor is not replenished if connections are lost or expire.
acquire_timeout: DurationHow long crate::Pool::get waits for a connection before failing.
idle_timeout: DurationClose a connection after this long without use.
max_lifetime: DurationClose a connection this long after it was created.
max_message_len: usizeLargest accepted backend message, in bytes, for connections created by
this pool. Overrides the URL’s max_message_len when a PoolConfig
is supplied explicitly.