Connection pool limits causing intermittent span export failures in Jaeger
0 reputation · 24 Jun 2023, 04:58 UTC
0 reputation · 24 Jun 2023, 04:58 UTC
When Jaeger’s client is subjected to high‑concurrency workloads, the HTTP/UDP connection pool can reach its configured maximum (typically 50 concurrent connections). Once exhausted, the exporter emits intermittent connection pool exhausted warnings, leading to silent span drops when the internal buffer (default size 1000) overflows.
Key constraints to consider are: the pool size, the span queue capacity, and the retry policy (max retries and interval). The client’s default behavior is to drop spans after retry attempts are exhausted, but the exact decision logic varies across language SDKs and Jaeger releases.
What is the optimal maximum connection count for sustained high throughput? How does the exporter determine when to drop spans versus retrying, especially when the queue is full? Is there a documented backpressure mechanism that can be enabled to prevent pool exhaustion when the collector is overloaded?
32275 reputation · 24 Jun 2023, 05:11 UTC
1. What is the optimal maximum connection count for sustained high throughput?
There is no single magic number. The right pool size is the smallest number that keeps the exporter’s p99 export latency flat while providing headroom for retries and collector‑side back‑pressure. A practical sizing rule is Little’s Law for the exporter:
PoolSize ≈ (SpansPerSecond × AvgExportLatency) + Headroom
Where Headroom is usually 20–30 % of the computed product to absorb bursty traffic and retry spikes. Verify this with a controlled load test instead of adopting the default 50 connections.
2. How does the exporter decide to drop spans versus retrying when the queue is full?
spans_dropped counter.
maxRetries times, waiting retryInterval between attempts.
spans_dropped counter is incremented again.
Note that the exact names of the counters and the order of operations vary between language SDKs and Jaeger releases, so always consult the documentation for the specific version you are using.
3. Is there a documented back‑pressure mechanism to prevent pool exhaustion when the collector is overloaded?
Jaeger’s legacy clients expose no true application‑level back‑pressure. The exporter’s queue is a simple drop‑on‑full buffer, and retries can amplify the problem. The recommended mitigations are:
BatchSpanProcessor with configurable queue size, batch size, and export timeout.
exporter_spans_exported, exporter_spans_dropped, exporter_queue_size, exporter_connections_in_use) and observe them under a steady load.
SpansPerSecond and AvgExportLatency.
maxConnections=200 for the HTTP client) and repeat the load test to confirm stability.
maxRetries or increase retryInterval with jitter.
To give a precise recommendation for your environment, could you tell me which Jaeger client SDK (e.g., Java, Go, Python) and version you are using, and whether you are sending via HTTP, gRPC, or UDP?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.