pub struct LimitsConfig {
pub body_max: u64,
pub request_timeout: Option<Duration>,
pub drain_timeout: Duration,
pub max_concurrency: Option<u32>,
}Fields§
§body_max: u64Max request body size. Accepts "10MB", "500KB", "2GB", raw byte count.
request_timeout: Option<Duration>Per-request timeout for the handler. None = no timeout.
drain_timeout: DurationGraceful shutdown timeout — on SIGTERM the server stops accepting
new connections, then waits up to this long for in-flight requests
to complete before dropping them. Default 10s matches SystemD’s
typical drain window. Raise for long-poll / large-upload workloads,
lower for fast-iteration deploys.
max_concurrency: Option<u32>Maximum concurrent in-flight requests across the whole server.
None = unlimited (Tokio’s default). When set, requests above the
cap immediately return HTTP 503 instead of queueing — this protects
against thundering-herd overload and lets a load balancer steer
traffic to healthy peers.
Set in config/anvil.toml as [limits] max_concurrency = 500.
Pick a value that matches the size of your DB pool × expected
per-request DB ops; over-provisioning here just shifts the
bottleneck elsewhere.
Trait Implementations§
Source§impl Clone for LimitsConfig
impl Clone for LimitsConfig
Source§fn clone(&self) -> LimitsConfig
fn clone(&self) -> LimitsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LimitsConfig
impl Debug for LimitsConfig
Source§impl Default for LimitsConfig
impl Default for LimitsConfig
Source§impl<'de> Deserialize<'de> for LimitsConfigwhere
LimitsConfig: Default,
impl<'de> Deserialize<'de> for LimitsConfigwhere
LimitsConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for LimitsConfig
impl RefUnwindSafe for LimitsConfig
impl Send for LimitsConfig
impl Sync for LimitsConfig
impl Unpin for LimitsConfig
impl UnsafeUnpin for LimitsConfig
impl UnwindSafe for LimitsConfig
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
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>
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