Workers Connection Limiting Relaxed - Improved Concurrent Request Handling
Key Points
- Six-connection limit now only applies during header-waiting phase
- Eliminated spurious connection cancellations from deadlock detection
- Workers can maintain significantly more concurrent connections
Summary
Cloudflare Workers has relaxed its simultaneous connection limiting mechanism to improve performance and eliminate spurious connection cancellations. The six-connection limit now only applies during the "waiting for headers" phase instead of the entire connection lifetime.
Key Points
- Connection counting changed: Connections are now freed as soon as response headers arrive, rather than after the full response is processed
- Increased concurrency: Workers can maintain many more simultaneous connections without queueing, as long as no more than six are waiting for initial response headers
- Eliminated spurious cancellations: Removed the fragile deadlock avoidance algorithm that could incorrectly cancel active connections during brief internal pauses (e.g., gzip decompression gaps)
- No more connection limit exceptions: The
Response closed due to connection limiterror should no longer occur due to false positive stall detection - Improved reliability: Connections complete normally regardless of internal processing pauses