[UPHPU] Question: Has anyone used forks before in a web app?

David Boucha boucha at gmail.com
Thu Jun 2 14:36:14 MDT 2005


On 6/2/05, Mac Newbold <mac at macnewbold.com> wrote:
> Today at 10:28am, David Boucha said:
> 
> > I have to do a lot of archiving of data and statistic gathering in an
> > app I'm working on. This data needs to be updated in near real time
> > and there are times I'd like to fork another process to take care of
> > this database number crunching so the user doesn't have to wait for it
> > to finish. I need to add a bunch of calculations, and I know it's
> > going to make certain pages unbearably slow if the user has to wait
> > for the number crunching.
> >
> > Has anyone used forking in a web app before? The php manual talks
> > about pcntl_fork(), but in the notes it seems that you have to use it
> > with php as a cgi. Is there another route I could take with this? A
> > cron job running an update script isn't going to do it.
> 
> A site I spent a lot of time working on (www.emulab.net) has a lot of
> these all over in it. As long as you're on a linux/BSD server, you can
> even just call system("cmd &") and have it fork that way. The code for
> emulab.net is open source, and last I checked, you could download it from
> their site, if you want to see how they do it.
> 
> Mac
> 


I'll go check it out. Thanks for the input

David Boucha




More information about the UPHPU mailing list