pub struct PoolLimits {
pub max_connections: u32,
pub idle_timeout: Option<Duration>,
pub acquire_timeout: Duration,
}Expand description
An open Postgres connection pool (sqlx 0.8, runtime-tokio,
tls-rustls).
One pool per tenant database: ADR 0008 keeps tenants isolated at the database boundary, and the native runtime (#19) holds one adapter per tenant. What one tenant’s pool may take (TENANT-ROUTING.md §4).
The per-tenant cap is what stops one busy tenant taking every connection on a shared cluster; the idle timeout is what stops a replica’s cost scaling with the tenant count rather than with its traffic, since a pool that no request has touched should not hold connections open.
acquire_timeout is the fail-closed half: a checkout that cannot be
served refuses with a deadline rather than queueing unboundedly, which
is the same instinct as the outbound budget in #136.
Fields§
§max_connections: u32Connections one tenant’s pool may hold. Default 8.
idle_timeout: Option<Duration>A pool with no checkout for this long closes its connections. Default 5 minutes.
acquire_timeout: DurationHow long a checkout waits before refusing. Default 5 seconds.
Trait Implementations§
Source§impl Clone for PoolLimits
impl Clone for PoolLimits
impl Copy for PoolLimits
Source§impl Debug for PoolLimits
impl Debug for PoolLimits
Source§impl Default for PoolLimits
impl Default for PoolLimits
impl Eq for PoolLimits
Source§impl PartialEq for PoolLimits
impl PartialEq for PoolLimits
impl StructuralPartialEq for PoolLimits
Auto Trait Implementations§
impl Freeze for PoolLimits
impl RefUnwindSafe for PoolLimits
impl Send for PoolLimits
impl Sync for PoolLimits
impl Unpin for PoolLimits
impl UnsafeUnpin for PoolLimits
impl UnwindSafe for PoolLimits
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more