It probably depends on his situation.

If this is not happening so frequently, then wasting an apache process 
shouldn't be so bad. Writing an entire daemon plus a protocol for 
communicating to it seems excessive in some cases and adds a point of 
failure (the new daemon).

Another alternative if you don't want to waste the apache process (all you 
are really losing is a preloaded cache that is taken away for awhile), is 
to have that process launch a perl script that then disconnects itself from 
your mod_perl script so that the mod_perl script is free to continue 
running. The fact that it takes up a bit of resources on your server 
shouldn't be so bad, again, if it's an issue of an infrequent process. The 
launching of the command could also be done via SSH to another server as 
well if you are worried about the load on the main one.

At 07:46 PM 10/13/00 -0400, Neil Conway wrote:
>On Fri, Oct 13, 2000 at 07:15:30PM -0400, Shimon Rura wrote:
> > I'd like to be able to tell apache to close off its connection with the
> > client but leave the script running.  An example use would be for the 
> client
> > to start a time-consuming job on the web server, and let it run without
> > subjecting them to a spinning wait icon for 10 minutes.
>
>This has been discussed in detail by the list recently. The solution
>you describe ('closing the connection to the client') is not ideal
>because it wastes 1 Apache child, which sits idle while it waits for
>the Perl script to complete. I think the consensus was that the best
>solution is to pass the request to an external program (possibly a
>daemon) through some method (RPC, 'queue' directory or DB table, etc),
>and then let the external program perform the time consuming task,
>while the mod_perl script returns the data to the client like normal.
>
>If I've got something wrong, sorry - check one of the archives for
>extensive discussion.
>
>HTH,
>
>Neil
>
>--
>Neil Conway <[EMAIL PROTECTED]>
>Get my GnuPG key from: http://klamath.dyndns.org/mykey.asc
>Encrypted mail welcomed
>
>Is uniformity [of religion] attainable? Millions of innocent men,
>women, and children, since the introduction of Christianity, have
>been burnt, tortured, fined, imprisoned; yet we have not advanced
>one inch towards uniformity.
>         -- Thomas Jefferson, "Notes on Virginia"

Reply via email to