duanhong8839 2014-06-06 05:54
浏览 49

检查所有cli进程是否已完成

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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 易康econgnition精度验证
    • ¥15 msix packaging tool打包问题
    • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败