<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Executing multiple curl requests in parallel with PHP and curl_multi_exec</title>
	<atom:link href="http://www.rustyrazorblade.com/2008/02/curl_multi_exec/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rustyrazorblade.com/2008/02/curl_multi_exec/</link>
	<description>Tech Thoughts, Mostly on LAMP - by Jon Haddad</description>
	<lastBuildDate>Sun, 07 Mar 2010 23:31:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jesper Wallin</title>
		<link>http://www.rustyrazorblade.com/2008/02/curl_multi_exec/comment-page-2/#comment-47359</link>
		<dc:creator>Jesper Wallin</dc:creator>
		<pubDate>Mon, 01 Feb 2010 12:45:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/02/20/executing-multiple-curl-requests-in-parallel-with-php-and-curl_multi_exec/#comment-47359</guid>
		<description>Thank you very much!

Lovely example on how to use the curl multi functions, really appreciated!


Regards</description>
		<content:encoded><![CDATA[<p>Thank you very much!</p>
<p>Lovely example on how to use the curl multi functions, really appreciated!</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymous</title>
		<link>http://www.rustyrazorblade.com/2008/02/curl_multi_exec/comment-page-2/#comment-44373</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Wed, 04 Nov 2009 15:29:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/02/20/executing-multiple-curl-requests-in-parallel-with-php-and-curl_multi_exec/#comment-44373</guid>
		<description>Hi,

Thanks very much,

I use this function to process pieces of my webpages containing php and mysql code in parallel.

I created a main php page that will call client php pages on localhost (or even another server). This way I can work around the fact that php is not multitasking. I can even use multiple servers at once as in cloud computing.

Kind regards,</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks very much,</p>
<p>I use this function to process pieces of my webpages containing php and mysql code in parallel.</p>
<p>I created a main php page that will call client php pages on localhost (or even another server). This way I can work around the fact that php is not multitasking. I can even use multiple servers at once as in cloud computing.</p>
<p>Kind regards,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://www.rustyrazorblade.com/2008/02/curl_multi_exec/comment-page-2/#comment-44234</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Fri, 30 Oct 2009 19:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/02/20/executing-multiple-curl-requests-in-parallel-with-php-and-curl_multi_exec/#comment-44234</guid>
		<description>Hey Tom,

You could do this:

$results[] = curl_multi_getcontent  ( $curl_arr[$i]  );</description>
		<content:encoded><![CDATA[<p>Hey Tom,</p>
<p>You could do this:</p>
<p>$results[] = curl_multi_getcontent  ( $curl_arr[$i]  );</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.rustyrazorblade.com/2008/02/curl_multi_exec/comment-page-2/#comment-44220</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Fri, 30 Oct 2009 07:03:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/02/20/executing-multiple-curl-requests-in-parallel-with-php-and-curl_multi_exec/#comment-44220</guid>
		<description>Hi, thanks for the tutorial, but how would I be able to take the outputs from the urls and put them into their own variables? I am making something that goes through a list of url and analyzes each one, it take a long time but with this it should be much faster, I just don&#039;t know how to implement that? Cheers.</description>
		<content:encoded><![CDATA[<p>Hi, thanks for the tutorial, but how would I be able to take the outputs from the urls and put them into their own variables? I am making something that goes through a list of url and analyzes each one, it take a long time but with this it should be much faster, I just don&#8217;t know how to implement that? Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Kerry</title>
		<link>http://www.rustyrazorblade.com/2008/02/curl_multi_exec/comment-page-2/#comment-41892</link>
		<dc:creator>John Kerry</dc:creator>
		<pubDate>Fri, 07 Aug 2009 15:31:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/02/20/executing-multiple-curl-requests-in-parallel-with-php-and-curl_multi_exec/#comment-41892</guid>
		<description>How to minimum cpu usage when use curl() function. My server only allow under 10% cpu usage.</description>
		<content:encoded><![CDATA[<p>How to minimum cpu usage when use curl() function. My server only allow under 10% cpu usage.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.rustyrazorblade.com/2008/02/curl_multi_exec/comment-page-2/#comment-41801</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 04 Aug 2009 16:33:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/02/20/executing-multiple-curl-requests-in-parallel-with-php-and-curl_multi_exec/#comment-41801</guid>
		<description>Hi,

it is very useful to run multple url in parallel.

but i met some problem in the array.
for example, i get multiple url in an array and i had array_filter them, so the array key does not follow from 0,1,2,3.....

The array key is like 3,4,7,8,10,14. 
And i would like to use your function to run them in parallel but array key not match if using for i=0,i $no as $url. At here i get many errors of variables n i unable to solve them. 

Most error occur at here
        $curl_arr = curl_init($url);
and here
$results = curl_multi_getcontent  ( curl_init($url)  );

sometimes i even get no value.

Can anyone give some example?

Sorry for my bothering.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>it is very useful to run multple url in parallel.</p>
<p>but i met some problem in the array.<br />
for example, i get multiple url in an array and i had array_filter them, so the array key does not follow from 0,1,2,3&#8230;..</p>
<p>The array key is like 3,4,7,8,10,14.<br />
And i would like to use your function to run them in parallel but array key not match if using for i=0,i $no as $url. At here i get many errors of variables n i unable to solve them. </p>
<p>Most error occur at here<br />
        $curl_arr = curl_init($url);<br />
and here<br />
$results = curl_multi_getcontent  ( curl_init($url)  );</p>
<p>sometimes i even get no value.</p>
<p>Can anyone give some example?</p>
<p>Sorry for my bothering.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tariq</title>
		<link>http://www.rustyrazorblade.com/2008/02/curl_multi_exec/comment-page-2/#comment-39386</link>
		<dc:creator>Tariq</dc:creator>
		<pubDate>Sat, 13 Jun 2009 12:36:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/02/20/executing-multiple-curl-requests-in-parallel-with-php-and-curl_multi_exec/#comment-39386</guid>
		<description>hi,

i wrote a little function which help me to get webpage content and deal with it in my program:
[code]
function request ($url) {
        $ch = curl_init ($url) ;
        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true) ;
        $res =curl_exec ($ch) ;
        curl_close ($ch) ;
        return ($res) ;}
[/code]
but when i call this function a lot e.g in some loop it reduce speed limits so i&#039;m wondering if there is a trick to speed it up

if it&#039;s important to talk about my program&#039;s job, let me send it to your email

thank you very much</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>i wrote a little function which help me to get webpage content and deal with it in my program:<br />
[code]<br />
function request ($url) {<br />
        $ch = curl_init ($url) ;<br />
        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true) ;<br />
        $res =curl_exec ($ch) ;<br />
        curl_close ($ch) ;<br />
        return ($res) ;}<br />
[/code]<br />
but when i call this function a lot e.g in some loop it reduce speed limits so i&#8217;m wondering if there is a trick to speed it up</p>
<p>if it&#8217;s important to talk about my program&#8217;s job, let me send it to your email</p>
<p>thank you very much</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody</title>
		<link>http://www.rustyrazorblade.com/2008/02/curl_multi_exec/comment-page-2/#comment-35927</link>
		<dc:creator>Cody</dc:creator>
		<pubDate>Thu, 26 Mar 2009 06:35:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/02/20/executing-multiple-curl-requests-in-parallel-with-php-and-curl_multi_exec/#comment-35927</guid>
		<description>wow.. this helped me tons..

i was only getting 20 request a minute because of latency.. but with this its not as much of an issue.

I&#039;m getting around 100 request give or take.</description>
		<content:encoded><![CDATA[<p>wow.. this helped me tons..</p>
<p>i was only getting 20 request a minute because of latency.. but with this its not as much of an issue.</p>
<p>I&#8217;m getting around 100 request give or take.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://www.rustyrazorblade.com/2008/02/curl_multi_exec/comment-page-2/#comment-35840</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Sun, 22 Mar 2009 17:48:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/02/20/executing-multiple-curl-requests-in-parallel-with-php-and-curl_multi_exec/#comment-35840</guid>
		<description>I don&#039;t see how the curl objects implementation is any better, it still has to wait on all requests to finish, if I&#039;m reading it correctly.  Just because there&#039;s more code in the while loop doesn&#039;t make it any better.

By all means, correct me if I&#039;m wrong, as I just glanced at the class.CurlBase.php file.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t see how the curl objects implementation is any better, it still has to wait on all requests to finish, if I&#8217;m reading it correctly.  Just because there&#8217;s more code in the while loop doesn&#8217;t make it any better.</p>
<p>By all means, correct me if I&#8217;m wrong, as I just glanced at the class.CurlBase.php file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: curlobjects</title>
		<link>http://www.rustyrazorblade.com/2008/02/curl_multi_exec/comment-page-2/#comment-35825</link>
		<dc:creator>curlobjects</dc:creator>
		<pubDate>Sun, 22 Mar 2009 01:15:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/02/20/executing-multiple-curl-requests-in-parallel-with-php-and-curl_multi_exec/#comment-35825</guid>
		<description>This will busy-loop, which is not good. Check out the CurlObjects implementation.

---
do {
    curl_multi_exec($master,$running);
} while($running &gt; 0);
----</description>
		<content:encoded><![CDATA[<p>This will busy-loop, which is not good. Check out the CurlObjects implementation.</p>
<p>&#8212;<br />
do {<br />
    curl_multi_exec($master,$running);<br />
} while($running &gt; 0);<br />
&#8212;-</p>
]]></content:encoded>
	</item>
</channel>
</rss>
