e111g
CDCloudflare Developers
•Created by tsp on 6/19/2023 in #workers-help
Error: socket hang up when sending 30+ parallel requests to a worker
HTTP requests to a Worker are load-balanced at the TCP level, so if you are making ~20-30 simultaneous connections from the same NodeJS script, many of those connections could get routed to the same worker instance (you can check this by generating some unique ID in your worker at runtime and appending it as a header to your responses). Each Worker instance is limited to 6 outbound connections, and any additional connections are queued up (transparently to you) until one of those 6 spots becomes empty. If your client is downloading file slowly, only 6 files will be (slowly) downloaded in parallel, and the other 15-25 connections are sitting idle. Perhaps those idle connections trip a wire somewhere in the net stack and get canceled as they have no observable aliveness.
3 replies