Skip to content

Commit a6e47d7

Browse files
authored
fix(app/env): a lower default maximum per-host connection limit (#4005)
* chore(app/env): fix typo Signed-off-by: katelyn martin <kate@buoyant.io> * fix(app/env): a lower default maximum per-host connection limit see also: * #4004 * linkerd/linkerd2#14204 in #4004 we fixed an issue related to our HTTP/1.1 client's connection pool. this further hedges against future issues related to our HTTP client exhausting resources available to its container. today, the limit by default is `usize::MAX`, which is dramatically higher than the practical limit. this commit changes the limit for outbound idle connections per-host to 10,000. Signed-off-by: katelyn martin <kate@buoyant.io> --------- Signed-off-by: katelyn martin <kate@buoyant.io>
1 parent 2cc8c7d commit a6e47d7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

linkerd/app/src/env.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,16 @@ const DEFAULT_INBOUND_HTTP1_CONNECTION_POOL_IDLE_TIMEOUT: Duration = Duration::f
343343
// TODO(ver) This should be configurable at the load balancer level.
344344
const DEFAULT_OUTBOUND_HTTP1_CONNECTION_POOL_IDLE_TIMEOUT: Duration = Duration::from_secs(3);
345345

346-
// By default, we don't limit the number of connections a connection pol may
346+
// By default, we don't limit the number of connections a connection pool may
347347
// use, as doing so can severely impact CPU utilization for applications with
348348
// many concurrent requests. It's generally preferable to use the MAX_IDLE_AGE
349349
// limitations to quickly drop idle connections.
350350
const DEFAULT_INBOUND_MAX_IDLE_CONNS_PER_ENDPOINT: usize = usize::MAX;
351-
const DEFAULT_OUTBOUND_MAX_IDLE_CONNS_PER_ENDPOINT: usize = usize::MAX;
351+
// By default, we limit the number of outbound connections that may be opened
352+
// per-host. We pick a high number (10k) that shouldn't interfere with most
353+
// workloads, but will prevent issues with our outbound HTTP client from
354+
// exhausting the file descriptors available to the process.
355+
const DEFAULT_OUTBOUND_MAX_IDLE_CONNS_PER_ENDPOINT: usize = 10_000;
352356

353357
// These settings limit the number of requests that have not received responses,
354358
// including those buffered in the proxy and dispatched to the destination

0 commit comments

Comments
 (0)