From 8f2f65db450a559011aaae23ec43a251501b20c2 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 7 Jul 2026 16:26:44 +1200 Subject: [PATCH] passing http_limit to httpx, and setting a smaller max connections --- apt_mirror/download/protocols/http.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apt_mirror/download/protocols/http.py b/apt_mirror/download/protocols/http.py index 0e10bd1..309f140 100644 --- a/apt_mirror/download/protocols/http.py +++ b/apt_mirror/download/protocols/http.py @@ -22,9 +22,9 @@ def __post_init__(self): base_url += "/" http_limits = httpx.Limits( - max_connections=256, - max_keepalive_connections=32, - keepalive_expiry=5, + max_connections=16, + max_keepalive_connections=4, + keepalive_expiry=1, ) client_certificate = None @@ -68,6 +68,7 @@ def __post_init__(self): follow_redirects=True, mounts=proxy_mounts, max_redirects=5, + limits=http_limits, headers={ "Accept-Encoding": "identity", "Cache-Control": "no-cache",