<div dir="ltr"><span style="font-size:13px">I have an application where I need to make 10s of millions of short-lived plain TCP (gen_tcp) or HTTP/HTTPS (httpc/gun/hackney) requests to different servers. The parameters for the requests are stored in a database. My plan is for a controlling gen_server on each node in the cluster to:</span><div><br><div style="font-size:13px">* grab a group of requests from the database </div><div style="font-size:13px">* spawn a process for each request </div><div style="font-size:13px">* the spawned process connects, makes the request, processes the response and shuts down the connection</div><div style="font-size:13px"><div><br></div><div>What is the best strategy to maximize the number of concurrent clients? My current plan is to maintain a list of pending requests in the controlling process (gen_server). As processes complete, they remove themselves from the list. If they error out on initialization I'd implement some sort of back-off timer, pushing the unexecuted requests back into the database if they couldn't execute after a predefined time limit.</div></div><div style="font-size:13px"><br></div><div style="font-size:13px">Is there a better way to maximize the number of TCP client connections per node in Erlang?</div><div style="font-size:13px"><br></div><div style="font-size:13px">Thanks.</div><div><br></div></div></div>