Skip to main content

DEFAULT_MAX_CONCURRENT_STREAMS

Constant DEFAULT_MAX_CONCURRENT_STREAMS 

Source
pub const DEFAULT_MAX_CONCURRENT_STREAMS: usize = 1024 /* 1_024usize */;
Expand description

Default ceiling on concurrent event queues: one per task being run, whether its send blocks or streams.

Every streaming request eagerly allocates channels and spawns background tasks, so an unlimited default let an unauthenticated caller grow server memory and task count without bound. 1024 concurrent streams is far above typical single-instance loads while still bounding resource use; raise it via RequestHandlerBuilder::with_max_concurrent_streams (up to usize::MAX to effectively disable the ceiling).