feat: adjust connection pool size calculation and comment out http2 prior knowledge

main
Yoo1tic 2025-07-20 01:43:40 +08:00
parent b77b27b8ec
commit 824c4f96dd
1 changed files with 3 additions and 3 deletions

View File

@ -6,12 +6,12 @@ use crate::config::KeyCheckerConfig;
pub fn client_builder(config: &KeyCheckerConfig) -> Result<Client, reqwest::Error> {
// Adjust connection pool size based on concurrency, optimizing for 0.5 second response time
let pool_size = (config.concurrency / 2).max(20).min(config.concurrency);
let pool_size = config.concurrency / 2;
let mut builder = Client::builder()
.timeout(Duration::from_secs(config.timeout_sec))
.pool_max_idle_per_host(pool_size)
.http2_prior_knowledge();
.pool_max_idle_per_host(pool_size);
// .http2_prior_knowledge();
if let Some(ref proxy_url) = config.proxy {
builder = builder.proxy(reqwest::Proxy::all(proxy_url.clone())?);