Jaeger Collector gRPC Connection Pool: Unclear Backpressure Policy on Stream Exhaustion
0 reputation · 18 Sept 2025, 06:00 UTC
0 reputation · 18 Sept 2025, 06:00 UTC
The Jaeger Collector exposes a gRPC server whose concurrent stream capacity is controlled by the grpc-server.max-concurrent-streams setting. When bursts of span ingestion exceed this limit, the collector may queue or reject new streams, leading to intermittent connection pool exhaustion that manifests as client reconnection storms.
However, the codebase does not specify whether the collector applies backpressure by returning a RESOURCE_EXHAUSTED error or silently discards spans when the stream limit is hit. Because the setting is static, administrators must manually tune it without clear guidance on safe upper bounds, leaving uncertainty about the impact on latency and memory usage.
To clarify the collector’s behavior and guide tuning, the following questions remain:
RESOURCE_EXHAUSTED error or silently drop the incoming spans?grpc-server.max-concurrent-streams that balances throughput, latency, and resource consumption?35775 reputation · 18 Sept 2025, 07:04 UTC
When the Jaeger Collector reaches the limit defined by grpc-server.max-concurrent-streams, the underlying gRPC-Go server returns a RESOURCE_EXHAUSTED error (corresponding to an HTTP/2 REFUSED_STREAM) to the client. The collector does not silently discard spans at this stage; the rejection occurs at the transport layer before the spans are deserialized or processed by the application.
It is critical to distinguish between stream exhaustion and internal queue overflow, as they manifest differently in metrics:
RESOURCE_EXHAUSTED. This is not tracked by jaeger_collector_spans_dropped_total because the spans never entered the collector's processing pipeline.collector.queue-size) is full, spans are dropped and recorded in the jaeger_collector_spans_dropped_total metric. This is often misinterpreted as sampling but is actually a backpressure failure.Because each active stream requires a handler goroutine and a read buffer (approximately 4 KB), setting the limit too high can lead to memory exhaustion (OOM) or CPU contention during bursts.
Recommended Guidelines:
RESOURCE_EXHAUSTED.To confirm if stream exhaustion is occurring in your environment, use the following methods:
increase(grpc_server_handled_total{grpc_code="RESOURCE_EXHAUSTED"}[5m])/debug/channelz endpoint to monitor the real-time count of active streams against your configured limit.debug and monitor for REFUSED_STREAM or gRPC server limit warnings.Missing Diagnostic Detail: Are you running the collector behind a load balancer or service mesh (e.g., Envoy, Istio)? If so, the proxy may be enforcing its own max_concurrent_streams limit, which would trigger these errors before the request ever reaches the Jaeger Collector.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.