<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 08 Jan 2009 02:35:16 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[John Lim's Blog: Parallel Processing in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11053</guid>
      <link>http://www.phpdeveloper.org/news/11053</link>
      <description><![CDATA[<p>
<i>John Lim</i> has two new posts covering parallel processing in PHP and how to use this "divide and conquer" idea to not only speed up your code but to make it more maintainable down the road.
</p>
<p>
In <a href="http://phplens.com/phpeverywhere/?q=node/view/254">the first post</a>:
</p>
<blockquote>
One problem we were having is that some of our batch processing jobs were taking too long to run. In order to speed the processing, we tried to split the processing file into half, and let a separate PHP process run each job. [...] Here is our technique for running multiple parallel jobs in PHP. In this example, we have two job files: j1.php and j2.php we want to run.
</blockquote>
<p>
The code is included for the job files and the "controller" that manages them. In the <A href="http://phplens.com/phpeverywhere/?q=node/view/255">second article</a>, he builds on this and shows a more practical example - finding the median of a set of records out of a database.
</p>]]></description>
      <pubDate>Mon, 22 Sep 2008 08:47:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPEverywhere: Simple Easy Parallel Processing in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10995</guid>
      <link>http://www.phpdeveloper.org/news/10995</link>
      <description><![CDATA[<p>
<i>John Lim</i> has <a href="http://phplens.com/phpeverywhere/?q=node/view/254">a new blog post</a> today sharing his method for simulating parallel processing inside of a PHP application.
</p>
<blockquote>
One problem we were having is that some of our batch processing jobs were taking too long to run. In order to speed the processing, we tried to split the processing file into half, and let a separate PHP process run each job. Given that we were using a dual core server, each process would be able to run close to full speed (subject to I/O constraints). 
</blockquote>
<p>
He shows the two "jobs" files that just echo out the job name and the number of seconds it's been running and the "control.php" that makes use of streams (pointed at localhost) to start the jobs apart from the main script. Another function checks the stream resource to see if it gets an EOF from it and returns back the output.
</p>]]></description>
      <pubDate>Wed, 10 Sep 2008 09:33:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Developer Tutorials Blog: Parallel web scraping in PHP: cURL multi functions]]></title>
      <guid>http://www.phpdeveloper.org/news/10701</guid>
      <link>http://www.phpdeveloper.org/news/10701</link>
      <description><![CDATA[<p>
The Developer Tutorials blog has <a href="http://www.developertutorials.com/blog/php/parallel-web-scraping-in-php-curl-multi-functions-375/">posted a tutorial</a> about scraping other website information in parallel (with their permission, of course) with the help of the <a href="http://www.php.net/curl">cURL extension</a>.
</p>
<blockquote>
For anyone who's ever tried to fetch multiple resources over HTTP in PHP, the logic is trivial, but one key challenge is ever-present: latency delays. While web servers have perfectly good downstream links, latencies can increase script execution time tenfold just by downloading a few external URLs. But there's a simple solution: parallel cURL operations. In this tutorial, I'll show you how to use the "multi" functions in PHP's cURL library to get around this quickly and easily.
</blockquote>
<p>
He starts with a basic cURL example, grabbing the content from example.com and putting it into a variable. He modifies this to make it a bit more complex and to run multiple fetches in parallel - creating more than one cURL object and using the culr_multi_* methods to manage them.
</p>]]></description>
      <pubDate>Tue, 29 Jul 2008 07:57:00 -0500</pubDate>
    </item>
  </channel>
</rss>
