 <p>You should have a look at this great module, <a href="https://github.com/caolan/async">async</a> which simplifies async tasks like this. You can use queue, simple example:</p> <pre><code>N = # of simultaneous tasks var q = async.queue(function (task, callback) { somehttprequestfunction(task.url, function(){ callback(); } }, N); q.drain = function() { console.log('all items have been processed'); } for(var i = 0; i &lt; 2000; i++){ q.push({url:"http://somewebsite.com/"+i+"/feed/"}); } </code></pre> <p>It will have a window of ongoing actions and the tasks room will be available for a future task if you only invoke the callback function. Difference is, your code now opens 2000 connections immidiately and obviously the failure rate is high. Limiting it to a reasonable value, 5,10,20 (depends on site and connection) will result in a better sucess rate. If a request fails, you can always try it again, or push the task to another async queue for another trial. The key point is to invoke callback() in queue function, so that a room will be available when it is done.</p>