williamZanelli Posted August 8, 2011 Share Posted August 8, 2011 Hi guys, I'm using cURL multi to send out post requests. My code is something like below - but with many more handles.. I'd like to send out 10,000+ requests [i have an array with 10k+ cURL handles,], whats the best and most efficient way of doing this? Thanks for your help & advice in advance. <?php //taken from http://php.net/manual/en/function.curl-multi-init.php // create both cURL resources $ch1 = curl_init(); $ch2 = curl_init(); // set URL and other appropriate options curl_setopt($ch1, CURLOPT_URL, "http://lxr.php.net/"); curl_setopt($ch1, CURLOPT_HEADER, 0); curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/"); curl_setopt($ch2, CURLOPT_HEADER, 0); //create the multiple cURL handle $mh = curl_multi_init(); //add the two handles curl_multi_add_handle($mh,$ch1); curl_multi_add_handle($mh,$ch2); $active = null; //execute the handles do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); while ($active && $mrc == CURLM_OK) { if (curl_multi_select($mh) != -1) { do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); } } //close the handles curl_multi_remove_handle($mh, $ch1); curl_multi_remove_handle($mh, $ch2); curl_multi_close($mh); ?> Quote Link to comment https://forums.phpfreaks.com/topic/244203-curl-scalability-help/ Share on other sites More sharing options...
trq Posted August 8, 2011 Share Posted August 8, 2011 Considering we get this kind of spam all day every day here there is no way I'm helping you write a script for it. Quote Link to comment https://forums.phpfreaks.com/topic/244203-curl-scalability-help/#findComment-1254191 Share on other sites More sharing options...
williamZanelli Posted August 8, 2011 Author Share Posted August 8, 2011 Haha Thorpe, Thanks for the reply. Its not spam I can assure you of this. Priavte message me and I will provide my email, we can chat that way? Quote Link to comment https://forums.phpfreaks.com/topic/244203-curl-scalability-help/#findComment-1254194 Share on other sites More sharing options...
AyKay47 Posted August 8, 2011 Share Posted August 8, 2011 you want to spam... but you don't know how! ha! Quote Link to comment https://forums.phpfreaks.com/topic/244203-curl-scalability-help/#findComment-1254197 Share on other sites More sharing options...
williamZanelli Posted August 8, 2011 Author Share Posted August 8, 2011 Its not spam guys! Look at my track record of questions.... Quote Link to comment https://forums.phpfreaks.com/topic/244203-curl-scalability-help/#findComment-1254205 Share on other sites More sharing options...
AyKay47 Posted August 8, 2011 Share Posted August 8, 2011 Its not spam guys! Look at my track record of questions.... then what is your purpose for this Quote Link to comment https://forums.phpfreaks.com/topic/244203-curl-scalability-help/#findComment-1254217 Share on other sites More sharing options...
williamZanelli Posted August 8, 2011 Author Share Posted August 8, 2011 Check your message for detailed response. Quote Link to comment https://forums.phpfreaks.com/topic/244203-curl-scalability-help/#findComment-1254442 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.