Spinning off time intensive procedures to speed CGI

Sam Penrose spenrose at well.com
Thu Dec 14 00:55:24 EST 2000


In article <916bpn$a6i$1 at nnrp1.deja.com>, leejor at my-deja.com wrote:

> I have a variety of time consuming proceedures that slow
> the response time of my CGI scripts. These are
> proceedures that do not send any information back to the
> web browser. I want to spin off these proceedures to
> allow the original program to imediately continue.
> Examples of these proceedures include: saving to Log
> files, sending emails, or caching database queries.
> 
> How do I accomplish this? I have played with fork() and
> os.system(), but have not achieved the results I need. In
> my searches of the documentation and online forums, I
> have only found methods that _wait_ for the spun off
> proceedures to return a result.
> 
> I don't want to wait.

Hhmm. I find that large (>10 modules, 1000's of lines of Python)
CGI-based systems perform quite reponsively on Intel hardware
while sending emails, saving file uploads, writing out text files,
etc. At least insofar as "responsive" means "load faster than the
New York Times home page over a T1."

If it's taking you, say, 20 seconds to send an email on more than
$200 worth of server under modest load, something other than
CGI is the problem.



More information about the Python-list mailing list