On 5/29/06, James.Q.L <[EMAIL PROTECTED]> wrote:
--- Mark Stosberg <[EMAIL PROTECTED]> wrote:
> One pattern to address this was proposed by Randal Schwartz in 1997:
> http://www.stonehenge.com/merlyn/WebTechniques/col20.html
>
> Simplified:
>
> Fork the long running process into the background. This process
> can report its status to a file as it goes.
>
> The page that the user sees can refresh it periodically, checking the status
> via the file and reporting back to the user.
>
> I've used this kind of pattern successfully myself.
>

haven't used mod_perl much. i am curious if it works well under mod_perl ?

Although forking mod_perl works fine, you are generally discouraged
from forking a mod_perl process, since you are forking a very large
process (the entire apache child process with mod_perl can be quite
large)).  What I usually do in that case is setup a job queue (on the
file system or in a database).  The web process writes some
information about a new job into the queue, and then there is a
separate daemon process (or cronjob) that checks intermittantly for
new work in the job queue, and runs the jobs.

You effectively get the same results, without having to fork your web
app.  You only incure a slight delay for processing to start until the
daemon process checks for new work.  Your result page can refresh for
updates just like in the forking process.

Cheers,

Cees

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to