Feature Request: Option to disable HTTP/2 multiplexing / force separate TCP connections per download
Summary
Add an option (e.g., --no-http2 flag or UV_NO_HTTP2 environment variable) to disable HTTP/2 multiplexing and force uv to use separate TCP connections for concurrent downloads.
Motivation
I'm using an aggregated proxy port that combines multiple upstream proxy servers to achieve bandwidth aggregation. The proxy distributes different TCP connections across different upstream servers, effectively multiplying the available bandwidth.
However, since uv uses HTTP/2 with connection multiplexing (enabled in PR #8049), all concurrent downloads to the same host (e.g., files.pythonhosted.org) are sent over a single TCP connection. This means:
- Even with
UV_CONCURRENT_DOWNLOADS=50, all requests to PyPI go through one connection - The aggregated proxy sees only one connection and routes all traffic through a single upstream server
- Bandwidth aggregation becomes impossible - I can only use the bandwidth of one upstream server instead of the combined bandwidth of all servers
Use Case
┌─── Upstream Proxy 1 (100 Mbps)
│
User ──► Aggregated Proxy Port ─────┼─── Upstream Proxy 2 (100 Mbps)
(distributes by TCP conn) │
└─── Upstream Proxy 3 (100 Mbps)Expected behavior: With 3 concurrent downloads, the proxy distributes them to 3 upstream servers → ~300 Mbps total bandwidth
Actual behavior: HTTP/2 multiplexes all downloads into 1 TCP connection → only ~100 Mbps (single upstream server)
Proposed Solution
Add one of the following options:
--no-http2/UV_NO_HTTP2=1- Disable HTTP/2, force HTTP/1.1--no-connection-reuse/UV_NO_CONNECTION_REUSE=1- Disable connection pooling/reuse--connections-per-host <N>/UV_CONNECTIONS_PER_HOST=<N>- Control max connections per host
Option 1 is probably the simplest to implement since reqwest already supports this via .http1_only() on the client builder.
Evidence: Aggregated Proxy Works Fine with Other Tools
To confirm the issue is with uv's HTTP/2 multiplexing (not my proxy setup), I tested downloading large models from Hugging Face using tools that create multiple TCP connections. The bandwidth aggregation works perfectly - I can see traffic being distributed across all upstream proxies and achieving the expected combined bandwidth.
This proves:
- My aggregated proxy setup is working correctly
- The issue is specifically that uv multiplexes all requests into a single TCP connection
Workaround
Currently there is no workaround. The HTTP/2 and connection pooling behavior is hardcoded.
Additional Context
- Related code:
pool_max_idle_per_host(20)in client initialization - HTTP/2 was enabled in #8049
- This affects users who rely on multi-path/multi-connection network setups for bandwidth aggregation (common in regions with limited single-connection bandwidth)
Example
No response
Source: astral-sh/uv