URLSession httpMaximumConnectionsPerHost: Latency Uncertainty in iOS 17
0 reputation · 21 May 2023, 10:11 UTC
URLSession’s httpMaximumConnectionsPerHost setting, introduced in iOS 17, allows developers to increase the number of simultaneous TCP connections a host can use. The default remains four, but the new dynamic configuration can raise this limit per host. Despite the option, Apple’s documentation does not guarantee that higher values will lower latency; the system may still throttle connections to preserve resources. In practice, heavy concurrent loads often produce latency spikes, even when the limit is increased, suggesting that HTTP/2 multiplexing and connection‑pooling heuristics play a larger role than the simple connection count.
The key unresolved question is how the iOS 17 networking stack balances new connection opens versus reuse under high‑concurrency scenarios. Understanding this balance is essential for tuning performance in real‑world apps.
1. Does raising httpMaximumConnectionsPerHost beyond four consistently reduce latency spikes for 100+ concurrent GET requests in iOS 17?
2. If not, which internal factors (HTTP/2 multiplexing, connection pooling, or system throttling) dominate latency behavior when the limit is increased?
3. How does the URLSession runtime decide when to open a new connection versus reusing an existing one under heavy load?