Workers - Relaxed simultaneous connection limiting for Workers
Key Points
- Six-connection limit now applies only while waiting for response headers
- Connections freed when response headers arrive; body reads no longer count
- Eliminates spurious cancellations and 'Response closed due to connection limit' errors
Summary
Cloudflare relaxed the Workers simultaneous open-connection limit. Previously each Worker invocation counted up to six open connections for their entire lifetime (including while reading the response body). Now a connection is freed as soon as response headers arrive, so the six-connection cap only applies to connections that are in the initial "waiting for headers" phase.
Key Points
- Limit now counts only connections that are waiting for initial response headers, not the entire connection lifetime.
- Connections are freed as soon as response headers arrive; subsequent body reads do not count against the six-connection quota.
- This change removes the fragile deadlock-avoidance heuristic that could cancel active connections (e.g., during brief internal pauses such as gzip decompression).
- Workers can now have many more concurrently open connections without queueing, provided no more than six are simultaneously waiting for headers.
Impact for engineers
- Reduced spurious "Response closed due to connection limit" errors and fewer unexpected cancellations.
- No mandatory code changes; long-lived or streaming responses are less likely to be penalized.
- If you create many outbound requests, prefer designs that allow upstreams to send headers promptly (or stream headers early) so requests do not accumulate in the waiting-for-headers queue.