Skip to content

Commit 799e684

Browse files
authored
feat: Allow setting pool_max_idle_per_host for http client (#10891)
Signed-off-by: Xuanwo <[email protected]>
1 parent 4d43264 commit 799e684

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/common/storage/src/operator.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,14 @@ fn init_s3_operator(cfg: &StorageS3Config) -> Result<impl Builder> {
249249
// Enable trust dns
250250
builder = builder.trust_dns(true);
251251

252+
// Pool max idle per host controls connection pool size.
253+
// Default to no limit, set to `0` for disable it.
254+
let pool_max_idle_per_host = env::var("_DATABEND_INTERNAL_POOL_MAX_IDLE_PER_HOST")
255+
.ok()
256+
.and_then(|v| v.parse::<usize>().ok())
257+
.unwrap_or(usize::MAX);
258+
builder = builder.pool_max_idle_per_host(pool_max_idle_per_host);
259+
252260
// Connect timeout default to 30s.
253261
let connect_timeout = env::var("_DATABEND_INTERNAL_CONNECT_TIMEOUT")
254262
.ok()

0 commit comments

Comments
 (0)