pub struct UpstreamPoolConfig {
pub pool_idle_timeout_ms: Option<u64>,
pub pool_max_idle_per_host: Option<u32>,
pub http2_keep_alive_interval_ms: Option<u64>,
pub http2_keep_alive_timeout_ms: Option<u64>,
pub http2_adaptive_window: bool,
pub max_concurrent_streams: Option<u32>,
pub pre_warm: Option<u32>,
pub per_endpoint_cap: Option<u32>,
pub max_connection_age_ms: Option<u64>,
pub http2_initial_stream_window_size: Option<u32>,
pub http2_initial_connection_window_size: Option<u32>,
}Expand description
DP-03: hyper connection-pool and HTTP/2 tuning for an upstream
(upstreams[].pool). Every field is optional; an omitted field
keeps hyper-util’s built-in default (the same value the gateway
used before this block existed), so the block is purely additive.
Validation rejects zero/negative-forbidden values; the runtime
clamps nothing beyond the documented bounds.
Fields§
§pool_idle_timeout_ms: Option<u64>How long an idle connection may sit in the pool before it is
closed (hyper-util pool_idle_timeout). In milliseconds.
Absent: hyper-util’s default (90 s). 0 is rejected at
validation (use a very small positive value to evict
aggressively, or omit the block for the default). Bounds: at
most 10 minutes (600000 ms).
pool_max_idle_per_host: Option<u32>Maximum number of idle connections retained per host
(hyper-util pool_max_idle_per_host). Absent: hyper-util’s
default. The per-upstream connection_cap still bounds the
total (active + idle) connections, so this only shapes the
idle fraction. Bounds: at most 1024.
http2_keep_alive_interval_ms: Option<u64>HTTP/2 PING keep-alive interval (hyper-util
http2_keep_alive_interval). In milliseconds. Absent: disabled
(hyper’s default — no PINGs). A positive value sends a PING
this often on an otherwise-idle h2 connection so proxies/ALB
in front of the upstream do not reap it. Only meaningful for
the http2 protocol; ignored for http1/https. Bounds: at
most 10 minutes (600000 ms).
http2_keep_alive_timeout_ms: Option<u64>HTTP/2 keep-alive timeout (hyper-util
http2_keep_alive_timeout): the time the client waits for a
PING ACK before closing the connection. In milliseconds.
Absent: hyper’s default (20 s). Does nothing when
http2_keep_alive_interval_ms is absent. Only meaningful for
the http2 protocol. Bounds: at most 10 minutes (600000 ms).
http2_adaptive_window: boolEnable HTTP/2 adaptive flow-control window (hyper-util
http2_adaptive_window). Absent: false (hyper’s default —
fixed initial window). When true, the connection window grows
and shrinks based on throughput, which helps large/long
responses on high-BDP paths. Only meaningful for the http2
protocol; ignored otherwise.
max_concurrent_streams: Option<u32>Initial cap on the number of concurrent HTTP/2 streams the
client will send over a single connection (hyper-util
http2_initial_max_send_streams). This is an initial value
only: hyper-util’s default is 100, and the effective cap is
further bounded by the server’s advertised
SETTINGS_MAX_CONCURRENT_STREAMS once the peer’s SETTINGS frame
arrives. A finite value bounds head-of-line blocking when one
stream stalls. Only meaningful for the http2 protocol.
Bounds: at least 1, at most 1_000_000.
pre_warm: Option<u32>SCALE-10 (#189): number of connections to pre-establish per
endpoint on startup/reload. Pre-warming removes cold-start
latency spikes after reloads and upgrade hand-offs. 0 or
absent: no pre-warming (the default — connections are
established on first use). Bounds: at most 64 per endpoint.
per_endpoint_cap: Option<u32>SCALE-10 (#189): per-endpoint connection cap, bounding
concurrent connections to a SINGLE endpoint (address:port)
within the upstream. The per-upstream connection_cap still
bounds the total across all endpoints; this knob prevents one
busy endpoint from monopolizing the upstream’s connection
budget. Absent: no per-endpoint cap (only the per-upstream
cap applies). Bounds: at least 1, at most 1024.
max_connection_age_ms: Option<u64>SCALE-10 (#189): maximum age of a pooled connection before it
is recycled. In milliseconds. Absent: no max-age (connections
live until the idle timeout or a peer-initiated close). A
positive value sets the pool idle timeout to the minimum of
this and pool_idle_timeout_ms, so connections are evicted
before they become stale. Bounds: at most 10 minutes
(600000 ms).
http2_initial_stream_window_size: Option<u32>Initial stream-level window size in bytes for the upstream h2
client (hyper http2_initial_stream_window_size). Absent:
hyper’s default. Larger values reduce flow-control stalls on
streaming (SSE) responses from the upstream but increase
memory per stream. Only meaningful for the http2 protocol.
Bounds: at most 16 MiB. (PERF-11, #244)
http2_initial_connection_window_size: Option<u32>Initial connection-level window size in bytes for the upstream
h2 client (hyper http2_initial_connection_window_size).
Absent: hyper’s default. Bounds: at most 64 MiB.
(PERF-11, #244)
Trait Implementations§
Source§impl Clone for UpstreamPoolConfig
impl Clone for UpstreamPoolConfig
Source§fn clone(&self) -> UpstreamPoolConfig
fn clone(&self) -> UpstreamPoolConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UpstreamPoolConfig
impl Debug for UpstreamPoolConfig
Source§impl<'de> Deserialize<'de> for UpstreamPoolConfig
impl<'de> Deserialize<'de> for UpstreamPoolConfig
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>,
Source§impl JsonSchema for UpstreamPoolConfig
impl JsonSchema for UpstreamPoolConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for UpstreamPoolConfig
impl PartialEq for UpstreamPoolConfig
Source§impl Serialize for UpstreamPoolConfig
impl Serialize for UpstreamPoolConfig
impl StructuralPartialEq for UpstreamPoolConfig
Auto Trait Implementations§
impl Freeze for UpstreamPoolConfig
impl RefUnwindSafe for UpstreamPoolConfig
impl Send for UpstreamPoolConfig
impl Sync for UpstreamPoolConfig
impl Unpin for UpstreamPoolConfig
impl UnwindSafe for UpstreamPoolConfig
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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