We've had a fair amount of success handing long processing jobs off to daemons (written with Net:Daemon, in most cases passing across args using Net::Telnet), using pages with reloading redirects to check the daemon status in a table.
Avoids much work in httpd, and allows user to hang up web connection and return later to continue viewing status. - Chris > -----Original Message----- > From: Mike P. Mikhailov [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, 22 January 2002 6:04 PM > To: eCap > Cc: [EMAIL PROTECTED] > Subject: Re: Forking another process in Apache? > > > Hello eCap, > > Monday, January 21, 2002, 10:45:37 PM, you wrote: > > e> A newbie question here... > e> I have a requirement to spin off a SQL loader process after a > web page (a > e> form which is qualified and accepted) has been submitted. Does it make > e> sense, or more importantly, is it dangerous to apply a "fork" > at the end of > e> a module such as this: > > > e> sub handler { > e> # do some qualification stuff here and accept the form submission... > e> if ($pid = fork) { > e> # parent > e> # ...whatever i need to accomplish to deliver return html code > e> return OK > e> } elsif { > e> # child > e> exec($sql_loader); > e> } else { > e> # ...whatever i ned to do to recover errors > e> return DECLINED > e> } > > e> } > > e> Are there any dangers in doing something like this? Or is there a more > e> efficient way to accomplish the same thing? > > e> Thanks for the advice, > e> Kirk > > > I'm recently implement exactly such loader. From the client HTTP > request I'm starting loader with double fork approach. I'm loading > posssible large enough (about 100 - 150 MB) data from DBF flat files > into Oracle in single transaction (I'm must provide consistency). > Loader process takes about 40-50 min to complete and consumes many > resources (CPU and RAM). But it works ! > > -- > WBR, Mike P. Mikhailov > mailto:[EMAIL PROTECTED] > > Pessimests are right more often, but optimists are happy more often > >