Skip to content

Commit bb2dc5e

Browse files
committed
feat(config): bump HttpConfig pool_max_idle_per_host default 10 -> 100
Matches the JDBC driver's `HttpConnectionPoolSize` default (100) and the kernel-internal `HttpClientConfig` default. Closes ~9x of the throughput gap with the NodeJS thrift driver's `maxSockets: Infinity` default for high-concurrency workloads (bursty parallel executeStatement, parallel CloudFetch chunk downloads). reqwest/hyper does not bound this; the prior 10 was a kernel-side conservative choice. Spec: sea-workflow/specs/07-errors-retries/connection-pool-default-mismatch.md Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
1 parent 5199c59 commit bb2dc5e

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

‎src/config.rs‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,13 @@ pub struct HttpConfig {
321321
/// Maximum total time across retries for a single logical RPC.
322322
pub overall_timeout: Duration,
323323

324-
/// Connection pool size.
324+
/// Connection pool size (max idle warm sockets per remote host).
325+
///
326+
/// Defaults to `100`, matching the JDBC driver's `HttpConnectionPoolSize`
327+
/// default. Raise this for workloads that burst many concurrent
328+
/// `executeStatement` calls or CloudFetch chunk downloads against a
329+
/// single host; too low a value forces fresh TLS handshakes when the
330+
/// pool fills.
325331
pub pool_max_idle_per_host: usize,
326332
}
327333

@@ -330,7 +336,7 @@ impl Default for HttpConfig {
330336
Self {
331337
request_timeout: Duration::from_secs(120),
332338
overall_timeout: Duration::from_secs(900),
333-
pool_max_idle_per_host: 10,
339+
pool_max_idle_per_host: 100,
334340
}
335341
}
336342
}
@@ -604,4 +610,15 @@ mod tests {
604610
assert!(s.contains("<redacted>"));
605611
assert!(s.contains("databricks"));
606612
}
613+
614+
// ─── HttpConfig defaults ───────────────────────────────────────
615+
616+
#[test]
617+
fn http_config_default_pool_max_idle_per_host_is_100() {
618+
// Matches the JDBC driver's `HttpConnectionPoolSize` default and
619+
// narrows the throughput gap with thrift's `maxSockets: Infinity`
620+
// for high-concurrency workloads. See
621+
// `sea-workflow/specs/07-errors-retries/connection-pool-default-mismatch.md`.
622+
assert_eq!(HttpConfig::default().pool_max_idle_per_host, 100);
623+
}
607624
}

0 commit comments

Comments
 (0)