News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPEverywhere:
Simple Easy Parallel Processing in PHP
September 10, 2008 @ 09:33:51

John Lim has a new blog post today sharing his method for simulating parallel processing inside of a PHP application.

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).

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.

0 comments voice your opinion now!
parallel processing tutorial stream job loop eof


blog comments powered by Disqus

Similar Posts

PHPit.net: PHP5 Class Basics, Part 1

Bruno Goncalves' Blog: Writting your first WordPress plugin

Richard Thomas: Solar Gets Firephp Support & a Base Controller Tip

PHPMac.com: Building and Installing Apache 2.2.2 and PHP 5.1.3 (or 5.1.4) on Mac OS X 10.4.6

PHPBuilder.com: Use the PHP Filter Extension to Validate User Data


Community Events





Don't see your event here?
Let us know!


composer community language opinion install library laravel tool release podcast package security symfony series framework voicesoftheelephpant update version interview introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework