On Saturday, February 15, 2014 11:58:14 AM UTC-5, Laurent Sertorius wrote: > > So, i want to request each urkl, but not in the same time, because sending > 200 000 http requests trigger error (web server : too many sockets > connections) > I use requestify.get(url).then(function(response), this object is asych, > and i would like to send just 50 http request in the same time : > > I'm not familiar with requestify, but with http.request() you can pass in your own Agent instance with a custom maxSockets like so:
var myAgent = new http.Agent({ maxSockets: 50 }); // inside loop here http.request({ // ... agent: myAgent, // ... }).end(); Then when all 50 sockets are in use, any new requests using the same Agent instance will be queued and sent out when a socket becomes available. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.