pub struct BgWriterConfig {
pub delay: Duration,
pub max_pages_per_round: usize,
pub lru_multiplier: f64,
pub max_dirty_fraction: f64,
}Expand description
Configuration for the background writer task. All fields
have PG-equivalent defaults; production code can override
via BgWriterConfig::with_* builders.
Fields§
§delay: DurationSleep between scan rounds.
max_pages_per_round: usizeMaximum dirty pages to flush per round. Soft limit — the writer stops at the first round that hits it.
lru_multiplier: f64LRU adaptive multiplier. The writer estimates how
many fresh buffers will be needed in the next round
based on recent allocation rate, then flushes
multiplier × estimate. Higher values flush more
aggressively; lower values save I/O at the cost of
query-side stall risk.
max_dirty_fraction: f64Soft cap on the dirty-page percentage. When the buffer
pool’s dirty fraction exceeds this, the writer scans
every round regardless of delay.
Trait Implementations§
Source§impl Clone for BgWriterConfig
impl Clone for BgWriterConfig
Source§fn clone(&self) -> BgWriterConfig
fn clone(&self) -> BgWriterConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BgWriterConfig
impl Debug for BgWriterConfig
Source§impl Default for BgWriterConfig
impl Default for BgWriterConfig
Source§fn default() -> BgWriterConfig
fn default() -> BgWriterConfig
Returns the “default value” for a type. Read more
impl Copy for BgWriterConfig
Auto Trait Implementations§
impl Freeze for BgWriterConfig
impl RefUnwindSafe for BgWriterConfig
impl Send for BgWriterConfig
impl Sync for BgWriterConfig
impl Unpin for BgWriterConfig
impl UnsafeUnpin for BgWriterConfig
impl UnwindSafe for BgWriterConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request