I have a web application and i have a huge report generation from few tables which contains millions of data. Since the process is a huge one i have used cli process to make it working. But now i have to improve the performance of the process i had split up one cli process into many.My scenario is like follows..
Say i have 1000 records for report generation. So i am dividing them onto 4 chunks with each containing 250 records each. So intially there was only one cli process. So now i split them into 4.
for($i = 1;$i <= 4;$i++){
exec('php path/to/file',$out);
}
Inside the file
//Some code
//Updating the completed time for the process in database
Each processes i am passing the limit and start for fetching records.Also i am logging each cli process into a table in which completed time is also there.Here i am considering the first process as the master process and the others as child process.Inside each process i am making the records for report generation. So after completing all processes i have to generate the report. So what i am trying to do is to update the completed time of the master process whenever all child processes are complete and so that i can generate the report also. But how to check all child processes are complete ..? Any help is much appreciated.. I am using PHP and Zend Framework